diff options
| author | Alex Flint <[email protected]> | 2017-03-30 14:10:29 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-03-30 14:10:29 -0700 |
| commit | cef6506c97e5731da728c374ff3523e481026423 (patch) | |
| tree | a62391d9019589f6fbc7ab44e74a47f1fd7daf8f /usage.go | |
| parent | 8111804d1774e2f9e2f7f734a15d2fb9ca684685 (diff) | |
| parent | 992acaf408ea8b884c7e62b990aba6c11c1715bc (diff) | |
Merge pull request #54 from k3a/master
Required multiple positionals
Diffstat (limited to 'usage.go')
| -rw-r--r-- | usage.go | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -54,7 +54,13 @@ func (p *Parser) WriteUsage(w io.Writer) { fmt.Fprint(w, " ") up := strings.ToUpper(spec.long) if spec.multiple { - fmt.Fprintf(w, "[%s [%s ...]]", up, up) + if !spec.required { + fmt.Fprint(w, "[") + } + fmt.Fprintf(w, "%s [%s ...]", up, up) + if !spec.required { + fmt.Fprint(w, "]") + } } else { fmt.Fprint(w, up) } |
