Skip to content

Commit 65f9835

Browse files
Philip Oakleygitster
authored andcommitted
builtin/help.c: add --guide option
Logic, but no actions, included. The --all commands option, if given, will display the list of available commands. The --guide option's list of guides will then be displayed. The common commands list is only displayed if neither option, nor a command or guide name, is given. Signed-off-by: Philip Oakley <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 15f7d49 commit 65f9835

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

builtin/help.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ enum help_format {
3636
static const char *html_path;
3737

3838
static int show_all = 0;
39+
static int show_guides = 0;
3940
static unsigned int colopts;
4041
static enum help_format help_format = HELP_FORMAT_NONE;
4142
static struct option builtin_help_options[] = {
4243
OPT_BOOL('a', "all", &show_all, N_("print all available commands")),
44+
OPT_BOOL('g', "guides", &show_guides, N_("print list of useful guides")),
4345
OPT_SET_INT('m', "man", &help_format, N_("show man page"), HELP_FORMAT_MAN),
4446
OPT_SET_INT('w', "web", &help_format, N_("show manual in web browser"),
4547
HELP_FORMAT_WEB),
@@ -49,7 +51,7 @@ static struct option builtin_help_options[] = {
4951
};
5052

5153
static const char * const builtin_help_usage[] = {
52-
N_("git help [--all] [--man|--web|--info] [command]"),
54+
N_("git help [--all] [--guides] [--man|--web|--info] [command]"),
5355
NULL
5456
};
5557

@@ -430,7 +432,11 @@ int cmd_help(int argc, const char **argv, const char *prefix)
430432
list_commands(colopts, &main_cmds, &other_cmds);
431433
}
432434

433-
if (show_all) {
435+
if (show_guides) {
436+
/* do action - next patch */
437+
}
438+
439+
if (show_all || show_guides) {
434440
printf("%s\n", _(git_more_info_string));
435441
/*
436442
* We're done. Ignore any remaining args

0 commit comments

Comments
 (0)