summaryrefslogtreecommitdiff
path: root/help.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-05-20 18:40:01 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-21 04:23:14 (GMT)
commit63eae83f8f301a1052cdde254b84f5da00e7b9b6 (patch)
treee7cdcb2b4e7f782e5fff9a87173e2ceda479497f /help.c
parent3c7777672bf9bc9ac2ddb422633b39af4faa1682 (diff)
downloadgit-63eae83f8f301a1052cdde254b84f5da00e7b9b6.zip
git-63eae83f8f301a1052cdde254b84f5da00e7b9b6.tar.gz
git-63eae83f8f301a1052cdde254b84f5da00e7b9b6.tar.bz2
help: add "-a --verbose" to list all commands with synopsis
This lists all recognized commands [1] by category. The group order follows closely git.txt. [1] We may actually show commands that are not built (e.g. if you set NO_PERL you don't have git-instaweb but it's still listed here). I ignore the problem because on Linux a git package could be split anyway. The "git-core" package may not contain git-instaweb even if it's built because it may end up in a separate package. We can't know anyway. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'help.c')
-rw-r--r--help.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/help.c b/help.c
index 1117f7d..c7df1d2 100644
--- a/help.c
+++ b/help.c
@@ -27,6 +27,17 @@ static struct category_description common_categories[] = {
{ CAT_remote, N_("collaborate (see also: git help workflows)") },
{ 0, NULL }
};
+static struct category_description main_categories[] = {
+ { CAT_mainporcelain, N_("Main Porcelain Commands") },
+ { CAT_ancillarymanipulators, N_("Ancillary Commands / Manipulators") },
+ { CAT_ancillaryinterrogators, N_("Ancillary Commands / Interrogators") },
+ { CAT_foreignscminterface, N_("Interacting with Others") },
+ { CAT_plumbingmanipulators, N_("Low-level Commands / Manipulators") },
+ { CAT_plumbinginterrogators, N_("Low-level Commands / Interrogators") },
+ { CAT_synchingrepositories, N_("Low-level Commands / Synching Repositories") },
+ { CAT_purehelpers, N_("Low-level Commands / Internal Helpers") },
+ { 0, NULL }
+};
static const char *drop_prefix(const char *name)
{
@@ -352,6 +363,11 @@ void list_cmds_by_category(struct string_list *list,
}
}
+void list_all_cmds_help(void)
+{
+ print_cmd_by_category(main_categories);
+}
+
int is_in_cmdlist(struct cmdnames *c, const char *s)
{
int i;