summaryrefslogtreecommitdiff
path: root/help.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-02-06 22:05:27 -0800
committerJunio C Hamano <gitster@pobox.com>2019-02-06 22:05:27 -0800
commit75e1a08b605b48a89d45d3b4401495909e0a61bf (patch)
treec18e6b7d4454a67d5c50edcc40d635f82ecd8b14 /help.c
parentcba595ab1a7764aecfde2e8e59994f89b2cd2f2e (diff)
parent6195a76da4b0c58b320d8f7c3485ee51b0f2a8e6 (diff)
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
Diffstat (limited to 'help.c')
-rw-r--r--help.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/help.c b/help.c
index ff05fd22df..520c9080e8 100644
--- a/help.c
+++ b/help.c
@@ -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));
}
}