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() {
|
func usage() {
|
||||||
|
fmt.Print(usagePrefix)
|
||||||
|
flag.PrintDefaults()
|
||||||
usageTmpl.Execute(os.Stdout, commands)
|
usageTmpl.Execute(os.Stdout, commands)
|
||||||
}
|
}
|
||||||
|
|
||||||
var usageTmpl = template.Must(template.New("usage").Parse(
|
var usagePrefix = `
|
||||||
`goose is a database migration management system for Go projects.
|
goose is a database migration management system for Go projects.
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
goose [options] <subcommand> [subcommand options]
|
goose [options] <subcommand> [subcommand options]
|
||||||
|
|
||||||
|
Options:
|
||||||
|
`
|
||||||
|
var usageTmpl = template.Must(template.New("usage").Parse(
|
||||||
|
`
|
||||||
Commands:{{range .}}
|
Commands:{{range .}}
|
||||||
{{.Name | printf "%-10s"}} {{.Summary}}{{end}}
|
{{.Name | printf "%-10s"}} {{.Summary}}{{end}}
|
||||||
`))
|
`))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user