diff options
| author | Alex Flint <[email protected]> | 2015-11-09 09:54:04 -0800 |
|---|---|---|
| committer | Alex Flint <[email protected]> | 2015-11-09 09:54:04 -0800 |
| commit | a6c77a413a4c616d5e6f4bcd5d7480e1dcb86465 (patch) | |
| tree | e2ffe6b645e6d83873b904104996f200fc131809 /usage.go | |
| parent | 53364a0be4ce4b3a84cefd6fac452fb953cd5acf (diff) | |
| parent | 383b8b84c14efaee9a36415704aaa8c22a167836 (diff) | |
Merge pull request #7 from brettlangdon/dev/trailing.whitespace.sqwished
Remove excess trailing whitespace from Usage generation
Diffstat (limited to 'usage.go')
| -rw-r--r-- | usage.go | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -27,10 +27,12 @@ func (p *Parser) WriteUsage(w io.Writer) { } } - fmt.Fprintf(w, "usage: %s ", filepath.Base(os.Args[0])) + fmt.Fprintf(w, "usage: %s", filepath.Base(os.Args[0])) // write the option component of the usage message for _, spec := range options { + // prefix with a space + fmt.Fprint(w, " ") if !spec.required { fmt.Fprint(w, "[") } @@ -38,18 +40,18 @@ func (p *Parser) WriteUsage(w io.Writer) { if !spec.required { fmt.Fprint(w, "]") } - fmt.Fprint(w, " ") } // write the positional component of the usage message for _, spec := range positionals { + // prefix with a space + fmt.Fprint(w, " ") up := strings.ToUpper(spec.long) if spec.multiple { fmt.Fprintf(w, "[%s [%s ...]]", up, up) } else { fmt.Fprint(w, up) } - fmt.Fprint(w, " ") } fmt.Fprint(w, "\n") } |
