Categories as slice, not a map anymore, order is always preserved

This commit is contained in:
Soulou
2015-08-21 10:58:14 +02:00
committed by Jesse Szwedko
parent a0801792cc
commit 994a7028e2
3 changed files with 37 additions and 5 deletions

View File

@@ -23,8 +23,8 @@ VERSION:
AUTHOR(S):
{{range .Authors}}{{ . }}{{end}}
{{end}}{{if .Commands}}
COMMANDS:{{if .CategorizedHelp}}{{range $category, $commands := .Categories}}{{if $category}}
{{$category}}{{ ":" }}{{end}}{{range $commands}}
COMMANDS:{{if .CategorizedHelp}}{{range .Categories}}{{if .Name}}
{{.Name}}{{ ":" }}{{end}}{{range .Commands}}
{{.Name}}{{with .ShortName}}, {{.}}{{end}}{{ "\t" }}{{.Usage}}{{end}}
{{end}}{{else}}{{range .Commands}}
{{.Name}}{{with .ShortName}}, {{.}}{{end}}{{ "\t" }}{{.Usage}}{{end}}