Skip to content

Commit 72f117b

Browse files
author
Robert Deusser
committed
Cleanup main help message to look cleaner
1 parent 7fddaf0 commit 72f117b

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

help.go

+16-13
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,22 @@ func helpFunc(commands map[string]cli.CommandFactory) string {
2828
}
2929
}
3030

31-
var buf bytes.Buffer
32-
buf.WriteString("usage: terraform [--version] [--help] <command> [args]\n\n")
33-
buf.WriteString(
34-
"The available commands for execution are listed below.\n" +
35-
"The most common, useful commands are shown first, followed by\n" +
36-
"less common or more advanced commands. If you're just getting\n" +
37-
"started with Terraform, stick with the common commands. For the\n" +
38-
"other commands, please read the help and docs before usage.\n\n")
39-
buf.WriteString("Common commands:\n")
40-
buf.WriteString(listCommands(porcelain, maxKeyLen))
41-
buf.WriteString("\nAll other commands:\n")
42-
buf.WriteString(listCommands(plumbing, maxKeyLen))
43-
return buf.String()
31+
helpText := fmt.Sprintf(`
32+
Usage: terraform [--version] [--help] <command> [args]
33+
34+
The available commands for execution are listed below.
35+
The most common, useful commands are shown first, followed by
36+
less common or more advanced commands. If you're just getting
37+
started with Terraform, stick with the common commands. For the
38+
other commands, please read the help and docs before usage.
39+
40+
Common commands:
41+
%s
42+
All other commands:
43+
%s
44+
`, listCommands(porcelain, maxKeyLen), listCommands(plumbing, maxKeyLen))
45+
46+
return strings.TrimSpace(helpText)
4447
}
4548

4649
// listCommands just lists the commands in the map with the

0 commit comments

Comments
 (0)