summaryrefslogtreecommitdiff
path: root/usage.go
diff options
context:
space:
mode:
authorAlex Flint <[email protected]>2020-01-23 11:07:40 -0800
committerGitHub <[email protected]>2020-01-23 11:07:40 -0800
commitf5d3733c0a632d810fb2f742a1b9caaef85374d9 (patch)
treeeb38238fdba666065b3fa665a7a6d302118477b9 /usage.go
parentced05bfe8a0f966d6ed09af656f5410bc5f4ed7c (diff)
parent9f5522668a8d573c5d5dbe6ee0584f395fba3806 (diff)
Merge pull request #104 from marco-m/subcommands-usage-simple
Subcommands usage simple
Diffstat (limited to 'usage.go')
-rw-r--r--usage.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/usage.go b/usage.go
index 57935fd..7ee68da 100644
--- a/usage.go
+++ b/usage.go
@@ -88,6 +88,12 @@ func (p *Parser) writeUsageForCommand(w io.Writer, cmd *command) {
fmt.Fprint(w, spec.placeholder)
}
}
+
+ // if the program supports subcommands, give a hint to the user about their existence
+ if len(cmd.subcommands) > 0 {
+ fmt.Fprint(w, " <command> [<args>]")
+ }
+
fmt.Fprint(w, "\n")
}