Merge branch 'nd/help-align-command-desc'

Output from "git help" was not correctly aligned, which has been
fixed.

* nd/help-align-command-desc:
  help: align the longest command in the command listing
This commit is contained in:
Junio C Hamano 2019-02-06 22:05:27 -08:00
commit 75e1a08b60

3
help.c
View file

@ -85,7 +85,8 @@ static void print_command_list(const struct cmdname_help *cmds,
if (cmds[i].category & mask) {
size_t len = strlen(cmds[i].name);
printf(" %s ", cmds[i].name);
mput_char(' ', longest > len ? longest - len : 1);
if (longest > len)
mput_char(' ', longest - len);
puts(_(cmds[i].help));
}
}