summaryrefslogtreecommitdiff
path: root/parse.go
diff options
context:
space:
mode:
authorAlex Flint <[email protected]>2019-05-03 15:02:10 -0700
committerAlex Flint <[email protected]>2019-05-03 15:02:10 -0700
commit15bf383f1d5db9bf362029529f3c83f092e2d00f (patch)
tree8cb7448834eacb0039546a5b10d896af11437400 /parse.go
parentedd1af466781355875c44cd9213ce1e398a4c84d (diff)
add subcommands to usage string
Diffstat (limited to 'parse.go')
-rw-r--r--parse.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/parse.go b/parse.go
index d06b299..3a48880 100644
--- a/parse.go
+++ b/parse.go
@@ -59,6 +59,7 @@ type spec struct {
// command represents a named subcommand, or the top-level command
type command struct {
name string
+ help string
dest path
specs []*spec
subcommands []*command
@@ -296,6 +297,8 @@ func cmdFromStruct(name string, dest path, t reflect.Type) (*command, error) {
return false
}
+ subcmd.help = field.Tag.Get("help")
+
cmd.subcommands = append(cmd.subcommands, subcmd)
isSubcommand = true
default: