diff options
| author | Alex Flint <[email protected]> | 2024-04-02 12:16:06 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-04-02 12:16:06 -0400 |
| commit | dfca71d1594a749ef5e2203e84cfb5a1b8e9387b (patch) | |
| tree | ca10ce099d08b010cd3b7def62f30afdfcf07d10 /usage.go | |
| parent | 188bd31bf60d57a7196c7547dd4bcd73298637ea (diff) | |
| parent | be792f1f8b2f3971c54e00240ea35a53512ec7bf (diff) | |
Merge pull request #243 from alexflint/handle-empty-placeholderv1.5.0
Handle explicit empty placeholders
Diffstat (limited to 'usage.go')
| -rw-r--r-- | usage.go | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -328,7 +328,10 @@ func (p *Parser) printEnvOnlyVar(w io.Writer, spec *spec) { } func synopsis(spec *spec, form string) string { - if spec.cardinality == zero { + // if the user omits the placeholder tag then we pick one automatically, + // but if the user explicitly specifies an empty placeholder then we + // leave out the placeholder in the help message + if spec.cardinality == zero || spec.placeholder == "" { return form } return form + " " + spec.placeholder |
