From 80d0f7653289103dcee54fae6b4ed115f74ac37a Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Tue, 1 Sep 2015 10:51:07 -0400 Subject: [PATCH] Improve subcommand help template Shows 'writeas' instead of generic 'command' --- writeas/cli.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/writeas/cli.go b/writeas/cli.go index 26a4489..542288c 100644 --- a/writeas/cli.go +++ b/writeas/cli.go @@ -171,6 +171,20 @@ func main() { }, } + cli.CommandHelpTemplate = `NAME: + {{.Name}} - {{.Usage}} + +USAGE: + writeas {{.Name}}{{if .Flags}} [command options]{{end}} [arguments...]{{if .Description}} + +DESCRIPTION: + {{.Description}}{{end}}{{if .Flags}} + +OPTIONS: + {{range .Flags}}{{.}} + {{end}}{{ end }} +` + app.Run(os.Args) }