From 67934e83050e8fd758f0ff5b74614a4a435e4725 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 789218454b..64eb032732 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()