mirror of
https://github.com/docker/docs.git
synced 2026-03-31 16:28:59 +07:00
Reformatting command-specific usage message
Signed-off-by: Dave Henderson <Dave.Henderson@ca.ibm.com>
This commit is contained in:
14
main.go
14
main.go
@@ -32,6 +32,19 @@ Commands:
|
||||
Run '{{.Name}} COMMAND --help' for more information on a command.
|
||||
`
|
||||
|
||||
var CommandHelpTemplate = `
|
||||
Usage: docker-machine {{.Name}}{{if .Flags}} [OPTIONS]{{end}} [arg...]
|
||||
|
||||
{{.Usage}}{{if .Description}}
|
||||
|
||||
Description:
|
||||
{{.Description}}{{end}}{{if .Flags}}
|
||||
|
||||
Options:
|
||||
{{range .Flags}}{{.}}
|
||||
{{end}}{{ end }}
|
||||
`
|
||||
|
||||
func main() {
|
||||
for _, f := range os.Args {
|
||||
if f == "-D" || f == "--debug" || f == "-debug" {
|
||||
@@ -41,6 +54,7 @@ func main() {
|
||||
}
|
||||
|
||||
cli.AppHelpTemplate = AppHelpTemplate
|
||||
cli.CommandHelpTemplate = CommandHelpTemplate
|
||||
app := cli.NewApp()
|
||||
app.Name = path.Base(os.Args[0])
|
||||
app.Author = "Docker Machine Contributors"
|
||||
|
||||
Reference in New Issue
Block a user