Merge pull request #9313 from iamthemuffinman/master

Cleanup main help message to look cleaner
This commit is contained in:
James Nugent 2016-10-10 22:44:51 -04:00 committed by GitHub
commit 4b992dc770
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