summaryrefslogtreecommitdiff
path: root/help.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-02-04 10:04:06 -0800
committerJunio C Hamano <gitster@pobox.com>2013-02-04 10:04:06 -0800
commitba8748e6d62c8020700a1437d74b80cfbd499379 (patch)
tree8f9120bdfadb18a3149ee5752bf50c8f7b785a5d /help.c
parent686b895928efcd577b541f589a016fc0182f3a2f (diff)
parent1542d4cdad9287896fd80d84a4c2256197087308 (diff)
downloadgit-ba8748e6d62c8020700a1437d74b80cfbd499379.tar.gz
Merge branch 'jc/help' into maint
* jc/help: help: include <common-cmds.h> only in one file
Diffstat (limited to 'help.c')
-rw-r--r--help.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/help.c b/help.c
index 2a42ec6d1f..1dfa0b0582 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;