diff options
| author | Alex Flint <[email protected]> | 2019-04-30 13:54:40 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-04-30 13:54:40 -0700 |
| commit | fb1ae1c3e0bd00d45333c3d51384afc05846f7a0 (patch) | |
| tree | 2014f28f27364532f07e82aad9472f2811a8c950 /usage.go | |
| parent | 78d30a555ccce677d4d535d30d62218b5f3c1a27 (diff) | |
| parent | 2267a587183189ac5c5d18478dba9b3c3f0eb2ec (diff) | |
Merge pull request #81 from alexflint/subcommands
small refactor to validation
Diffstat (limited to 'usage.go')
| -rw-r--r-- | usage.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,12 +1,12 @@ package arg import ( + "encoding" "fmt" "io" "os" "reflect" "strings" - "encoding" ) // the width of the left column @@ -22,7 +22,7 @@ func (p *Parser) Fail(msg string) { // WriteUsage writes usage information to the given writer func (p *Parser) WriteUsage(w io.Writer) { var positionals, options []*spec - for _, spec := range p.spec { + for _, spec := range p.specs { if spec.positional { positionals = append(positionals, spec) } else { @@ -72,7 +72,7 @@ func (p *Parser) WriteUsage(w io.Writer) { // WriteHelp writes the usage string followed by the full help string for each option func (p *Parser) WriteHelp(w io.Writer) { var positionals, options []*spec - for _, spec := range p.spec { + for _, spec := range p.specs { if spec.positional { positionals = append(positionals, spec) } else { |
