X-Git-Url: http://git.tremily.us/?a=blobdiff_plain;f=help.c;h=1dfa0b05827e6e75dc463092b2838cd1c991623c;hb=d2216a4b133f90a543a0e4c4a9f9809a043012d6;hp=2a42ec6d1f312b573d7b1da1a15471d21efc5b4d;hpb=267aaa08e2e9b236d4ace006055066e353af8038;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;