Merge pull request #123 from AudriusButkevicius/help

Additional help cleanup
This commit is contained in:
Jeremy Saenz 2014-08-02 12:56:38 -07:00
commit ec11175ac1

16
help.go
View File

@ -14,7 +14,7 @@ var AppHelpTemplate = `NAME:
{{.Name}} - {{.Usage}} {{.Name}} - {{.Usage}}
USAGE: USAGE:
{{.Name}} {{ if .Flags }}[global options] {{ end }}command{{ if .Flags }} [command options]{{ end }} [arguments...] {{.Name}} {{if .Flags}}[global options] {{end}}command{{if .Flags}} [command options]{{end}} [arguments...]
VERSION: VERSION:
{{.Version}}{{if or .Author .Email}} {{.Version}}{{if or .Author .Email}}
@ -25,10 +25,10 @@ AUTHOR:{{if .Author}}
COMMANDS: COMMANDS:
{{range .Commands}}{{.Name}}{{with .ShortName}}, {{.}}{{end}}{{ "\t" }}{{.Usage}} {{range .Commands}}{{.Name}}{{with .ShortName}}, {{.}}{{end}}{{ "\t" }}{{.Usage}}
{{end}}{{ if .Flags }} {{end}}{{if .Flags}}
GLOBAL OPTIONS: GLOBAL OPTIONS:
{{range .Flags}}{{.}} {{range .Flags}}{{.}}
{{end}}{{ end }} {{end}}{{end}}
` `
// The text template for the command help topic. // The text template for the command help topic.
@ -38,10 +38,10 @@ var CommandHelpTemplate = `NAME:
{{.Name}} - {{.Usage}} {{.Name}} - {{.Usage}}
USAGE: USAGE:
command {{.Name}}{{ if .Flags }} [command options]{{ end }} [arguments...] command {{.Name}}{{if .Flags}} [command options]{{end}} [arguments...]{{if .Description}}
DESCRIPTION: DESCRIPTION:
{{.Description}}{{ if .Flags }} {{.Description}}{{end}}{{if .Flags}}
OPTIONS: OPTIONS:
{{range .Flags}}{{.}} {{range .Flags}}{{.}}
@ -55,14 +55,14 @@ var SubcommandHelpTemplate = `NAME:
{{.Name}} - {{.Usage}} {{.Name}} - {{.Usage}}
USAGE: USAGE:
{{.Name}} command{{ if .Flags }} [command options]{{ end }} [arguments...] {{.Name}} command{{if .Flags}} [command options]{{end}} [arguments...]
COMMANDS: COMMANDS:
{{range .Commands}}{{.Name}}{{with .ShortName}}, {{.}}{{end}}{{ "\t" }}{{.Usage}} {{range .Commands}}{{.Name}}{{with .ShortName}}, {{.}}{{end}}{{ "\t" }}{{.Usage}}
{{end}}{{ if .Flags }} {{end}}{{if .Flags}}
OPTIONS: OPTIONS:
{{range .Flags}}{{.}} {{range .Flags}}{{.}}
{{end}}{{ end }} {{end}}{{end}}
` `
var helpCommand = Command{ var helpCommand = Command{