path: root/builtin
diff options
authorNguyễn Thái Ngọc Duy <>2018-05-20 18:40:01 (GMT)
committerJunio C Hamano <>2018-05-21 04:23:14 (GMT)
commit63eae83f8f301a1052cdde254b84f5da00e7b9b6 (patch)
treee7cdcb2b4e7f782e5fff9a87173e2ceda479497f /builtin
parent3c7777672bf9bc9ac2ddb422633b39af4faa1682 (diff)
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 <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin')
1 files changed, 7 insertions, 0 deletions
diff --git a/builtin/help.c b/builtin/help.c
index 598867c..0e0af84 100644
--- a/builtin/help.c
+++ b/builtin/help.c
@@ -36,6 +36,7 @@ static const char *html_path;
static int show_all = 0;
static int show_guides = 0;
+static int verbose;
static unsigned int colopts;
static enum help_format help_format = HELP_FORMAT_NONE;
static int exclude_guides;
@@ -48,6 +49,7 @@ static struct option builtin_help_options[] = {
OPT_SET_INT('i', "info", &help_format, N_("show info page"),
+ OPT__VERBOSE(&verbose, N_("print command description")),
@@ -463,6 +465,11 @@ int cmd_help(int argc, const char **argv, const char *prefix)
if (show_all) {
git_config(git_help_config, NULL);
+ if (verbose) {
+ setup_pager();
+ list_all_cmds_help();
+ return 0;
+ }
printf(_("usage: %s%s"), _(git_usage_string), "\n\n");
load_command_list("git-", &main_cmds, &other_cmds);
list_commands(colopts, &main_cmds, &other_cmds);