summaryrefslogtreecommitdiff
path: root/usage.go
diff options
context:
space:
mode:
Diffstat (limited to 'usage.go')
-rw-r--r--usage.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/usage.go b/usage.go
index 0c68ee7..6b578a5 100644
--- a/usage.go
+++ b/usage.go
@@ -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