git: support --list-cmds=list-<category>
[gitweb.git] / git.c
diff --git a/git.c b/git.c
index 10907f7266331f0d34a6262ef1257940aafeca2f..4d5b8a99311da56596654ae6af9656f15df00707 100644 (file)
--- a/git.c
+++ b/git.c
@@ -60,6 +60,13 @@ static int list_cmds(const char *spec)
                        list_all_main_cmds(&list);
                else if (match_token(spec, len, "others"))
                        list_all_other_cmds(&list);
+               else if (len > 5 && !strncmp(spec, "list-", 5)) {
+                       struct strbuf sb = STRBUF_INIT;
+
+                       strbuf_add(&sb, spec + 5, len - 5);
+                       list_cmds_by_category(&list, sb.buf);
+                       strbuf_release(&sb);
+               }
                else
                        die(_("unsupported command listing type '%s'"), spec);
                spec += len;