From 6418fbb3d4cec5ccfdcfe2d3596d559f36c2e02e Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Tue, 28 Apr 2015 14:11:01 -0400 Subject: [PATCH] Reformatting command-specific usage message Signed-off-by: Dave Henderson --- main.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/main.go b/main.go index 8ed327b101..1b0b4473be 100644 --- a/main.go +++ b/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"