Skip to content

Commit 80d0f76

Browse files
committed
Improve subcommand help template
Shows 'writeas' instead of generic 'command'
1 parent 995d73d commit 80d0f76

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

writeas/cli.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,20 @@ func main() {
171171
},
172172
}
173173

174+
cli.CommandHelpTemplate = `NAME:
175+
{{.Name}} - {{.Usage}}
176+
177+
USAGE:
178+
writeas {{.Name}}{{if .Flags}} [command options]{{end}} [arguments...]{{if .Description}}
179+
180+
DESCRIPTION:
181+
{{.Description}}{{end}}{{if .Flags}}
182+
183+
OPTIONS:
184+
{{range .Flags}}{{.}}
185+
{{end}}{{ end }}
186+
`
187+
174188
app.Run(os.Args)
175189
}
176190

0 commit comments

Comments
 (0)