From 248cf7f13ab2ccae73b4cf26fba0717275d7db4f Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Fri, 23 Oct 2020 16:59:29 -0700 Subject: [PATCH] main: A slightly more compact presentation of the main help text This just reduces the amount of space between different elements on in the main help output from four columns to two. The main motivation here was to give some of the longer command descriptions a little more horizontal breathing room, but subjectively I also find the tighter column gutters easier to scan. Others may disagree, of course. --- help.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/help.go b/help.go index 789218454..64eb03273 100644 --- a/help.go +++ b/help.go @@ -55,11 +55,10 @@ Main commands: All other commands: %s Global options (use these before the subcommand, if any): - -chdir=DIR Switch to a different working directory before executing - the given subcommand. - -help Show this help output, or the help for a specified - subcommand. - -version An alias for the "version" subcommand. + -chdir=DIR Switch to a different working directory before executing the + given subcommand. + -help Show this help output, or the help for a specified subcommand. + -version An alias for the "version" subcommand. `, listCommands(commands, PrimaryCommands, maxKeyLen), listCommands(commands, otherCommands, maxKeyLen)) return strings.TrimSpace(helpText) @@ -88,7 +87,7 @@ func listCommands(allCommands map[string]cli.CommandFactory, order []string, max } key = fmt.Sprintf("%s%s", key, strings.Repeat(" ", maxKeyLen-len(key))) - buf.WriteString(fmt.Sprintf(" %s %s\n", key, command.Synopsis())) + buf.WriteString(fmt.Sprintf(" %s %s\n", key, command.Synopsis())) } return buf.String()