Reformatting command-specific usage message

Signed-off-by: Dave Henderson <Dave.Henderson@ca.ibm.com>
This commit is contained in:
Dave Henderson 2015-04-28 14:11:01 -04:00
parent d9ae6dd871
commit 6418fbb3d4
1 changed files with 14 additions and 0 deletions

14
main.go
View File

@ -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"