mirror of
https://github.com/pressly/goose.git
synced 2025-05-31 11:42:04 +00:00
Show usage options in help string
This commit is contained in:
parent
3c6b6c35c4
commit
1cae7f2834
10
main.go
10
main.go
@ -45,15 +45,21 @@ func main() {
|
||||
}
|
||||
|
||||
func usage() {
|
||||
fmt.Print(usagePrefix)
|
||||
flag.PrintDefaults()
|
||||
usageTmpl.Execute(os.Stdout, commands)
|
||||
}
|
||||
|
||||
var usageTmpl = template.Must(template.New("usage").Parse(
|
||||
`goose is a database migration management system for Go projects.
|
||||
var usagePrefix = `
|
||||
goose is a database migration management system for Go projects.
|
||||
|
||||
Usage:
|
||||
goose [options] <subcommand> [subcommand options]
|
||||
|
||||
Options:
|
||||
`
|
||||
var usageTmpl = template.Must(template.New("usage").Parse(
|
||||
`
|
||||
Commands:{{range .}}
|
||||
{{.Name | printf "%-10s"}} {{.Summary}}{{end}}
|
||||
`))
|
||||
|
Loading…
x
Reference in New Issue
Block a user