summaryrefslogtreecommitdiff
path: root/usage.go
diff options
context:
space:
mode:
authorAlex Flint <[email protected]>2019-12-01 01:22:05 -0800
committerGitHub <[email protected]>2019-12-01 01:22:05 -0800
commitced05bfe8a0f966d6ed09af656f5410bc5f4ed7c (patch)
tree75a1540bde1cf3b46b45854e5043ca2100638888 /usage.go
parentc0c7a3ba8a1854cd85e65cca4f0e2028698a0738 (diff)
parent9d4521ce8be4871b3ba85cb1bfa96f4b074f505b (diff)
Merge pull request #96 from Andrew-Morozko/master
Added the "placeholder" tag
Diffstat (limited to 'usage.go')
-rw-r--r--usage.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/usage.go b/usage.go
index 43db703..57935fd 100644
--- a/usage.go
+++ b/usage.go
@@ -76,17 +76,16 @@ func (p *Parser) writeUsageForCommand(w io.Writer, cmd *command) {
for _, spec := range positionals {
// prefix with a space
fmt.Fprint(w, " ")
- up := strings.ToUpper(spec.long)
if spec.multiple {
if !spec.required {
fmt.Fprint(w, "[")
}
- fmt.Fprintf(w, "%s [%s ...]", up, up)
+ fmt.Fprintf(w, "%s [%s ...]", spec.placeholder, spec.placeholder)
if !spec.required {
fmt.Fprint(w, "]")
}
} else {
- fmt.Fprint(w, up)
+ fmt.Fprint(w, spec.placeholder)
}
}
fmt.Fprint(w, "\n")
@@ -134,7 +133,7 @@ func (p *Parser) writeHelpForCommand(w io.Writer, cmd *command) {
if len(positionals) > 0 {
fmt.Fprint(w, "\nPositional arguments:\n")
for _, spec := range positionals {
- printTwoCols(w, strings.ToUpper(spec.long), spec.help, "")
+ printTwoCols(w, spec.placeholder, spec.help, "")
}
}
@@ -180,7 +179,7 @@ func synopsis(spec *spec, form string) string {
if spec.boolean {
return form
}
- return form + " " + strings.ToUpper(spec.long)
+ return form + " " + spec.placeholder
}
func ptrTo(s string) *string {