X-Git-Url: http://git.tremily.us/?a=blobdiff_plain;f=help.c;h=1dfa0b05827e6e75dc463092b2838cd1c991623c;hb=393b7c3cd7c87a42e2e477de38d4a6e4981db8bb;hp=2a42ec6d1f312b573d7b1da1a15471d21efc5b4d;hpb=51c6de2bab06562d0e69dcfd48f04a3b28a878b1;p=git.git diff --git a/help.c b/help.c index 2a42ec6d1..1dfa0b058 100644 --- a/help.c +++ b/help.c @@ -223,6 +223,23 @@ void list_commands(unsigned int colopts, } } +void list_common_cmds_help(void) +{ + int i, longest = 0; + + for (i = 0; i < ARRAY_SIZE(common_cmds); i++) { + if (longest < strlen(common_cmds[i].name)) + longest = strlen(common_cmds[i].name); + } + + puts(_("The most commonly used git commands are:")); + for (i = 0; i < ARRAY_SIZE(common_cmds); i++) { + printf(" %s ", common_cmds[i].name); + mput_char(' ', longest - strlen(common_cmds[i].name)); + puts(_(common_cmds[i].help)); + } +} + int is_in_cmdlist(struct cmdnames *c, const char *s) { int i;