From 72f117b6c56cefa0122d5685a614278ab505924e Mon Sep 17 00:00:00 2001 From: Robert Deusser Date: Mon, 10 Oct 2016 14:47:35 -0400 Subject: [PATCH] Cleanup main help message to look cleaner --- help.go | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/help.go b/help.go index fcc6dc95d..0358942ec 100644 --- a/help.go +++ b/help.go @@ -28,19 +28,22 @@ func helpFunc(commands map[string]cli.CommandFactory) string { } } - var buf bytes.Buffer - buf.WriteString("usage: terraform [--version] [--help] [args]\n\n") - buf.WriteString( - "The available commands for execution are listed below.\n" + - "The most common, useful commands are shown first, followed by\n" + - "less common or more advanced commands. If you're just getting\n" + - "started with Terraform, stick with the common commands. For the\n" + - "other commands, please read the help and docs before usage.\n\n") - buf.WriteString("Common commands:\n") - buf.WriteString(listCommands(porcelain, maxKeyLen)) - buf.WriteString("\nAll other commands:\n") - buf.WriteString(listCommands(plumbing, maxKeyLen)) - return buf.String() + helpText := fmt.Sprintf(` +Usage: terraform [--version] [--help] [args] + +The available commands for execution are listed below. +The most common, useful commands are shown first, followed by +less common or more advanced commands. If you're just getting +started with Terraform, stick with the common commands. For the +other commands, please read the help and docs before usage. + +Common commands: +%s +All other commands: +%s +`, listCommands(porcelain, maxKeyLen), listCommands(plumbing, maxKeyLen)) + + return strings.TrimSpace(helpText) } // listCommands just lists the commands in the map with the