Sets a subcommand's parent cmd

This allows the help output to show the correct/full command path to the
subcommand.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
Brian Goff
2015-06-20 19:59:54 -04:00
parent f9982619cc
commit 758ad1e836
3 changed files with 51 additions and 4 deletions

View File

@@ -20,7 +20,7 @@ USAGE:
VERSION:
{{.Version}}
{{end}}{{if len .Authors}}
AUTHOR(S):
AUTHOR(S):
{{range .Authors}}{{ . }}{{end}}
{{end}}{{if .Commands}}
COMMANDS:
@@ -38,10 +38,10 @@ COPYRIGHT:
// cli.go uses text/template to render templates. You can
// render custom help text by setting this variable.
var CommandHelpTemplate = `NAME:
{{.Name}} - {{.Usage}}
{{.FullName}} - {{.Usage}}
USAGE:
command {{.Name}}{{if .Flags}} [command options]{{end}} [arguments...]{{if .Description}}
command {{.FullName}}{{if .Flags}} [command options]{{end}} [arguments...]{{if .Description}}
DESCRIPTION:
{{.Description}}{{end}}{{if .Flags}}