Cleanup main help message to look cleaner

This commit is contained in:
Robert Deusser 2016-10-10 14:47:35 -04:00
parent 7fddaf04bd
commit 72f117b6c5
1 changed files with 16 additions and 13 deletions

29
help.go
View File

@ -28,19 +28,22 @@ func helpFunc(commands map[string]cli.CommandFactory) string {
} }
} }
var buf bytes.Buffer helpText := fmt.Sprintf(`
buf.WriteString("usage: terraform [--version] [--help] <command> [args]\n\n") Usage: terraform [--version] [--help] <command> [args]
buf.WriteString(
"The available commands for execution are listed below.\n" + The available commands for execution are listed below.
"The most common, useful commands are shown first, followed by\n" + The most common, useful commands are shown first, followed by
"less common or more advanced commands. If you're just getting\n" + less common or more advanced commands. If you're just getting
"started with Terraform, stick with the common commands. For the\n" + started with Terraform, stick with the common commands. For the
"other commands, please read the help and docs before usage.\n\n") other commands, please read the help and docs before usage.
buf.WriteString("Common commands:\n")
buf.WriteString(listCommands(porcelain, maxKeyLen)) Common commands:
buf.WriteString("\nAll other commands:\n") %s
buf.WriteString(listCommands(plumbing, maxKeyLen)) All other commands:
return buf.String() %s
`, listCommands(porcelain, maxKeyLen), listCommands(plumbing, maxKeyLen))
return strings.TrimSpace(helpText)
} }
// listCommands just lists the commands in the map with the // listCommands just lists the commands in the map with the