Re: [PATCH 6/7] help: add --no-[external-commands|aliases] for use with --all

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Dec 28, 2021 at 10:36 AM Ævar Arnfjörð Bjarmason
<avarab@xxxxxxxxx> wrote:
> Add the ability to only emit git's own usage information under
> --all. This also allows us to extend the "test_section_spacing" tests
> added in a preceding commit to test "git help --all"
> output.
>
> Previously we could not do that, as the tests might find a git-*
> command in the "$PATH", which would make the output differ from one
> setup to another.
>
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx>
> ---
> diff --git a/Documentation/git-help.txt b/Documentation/git-help.txt
> @@ -8,7 +8,7 @@ git-help - Display help information about Git
> -'git help' [-a|--all] [--[no-]verbose]
> +'git help' [-a|--all] [--[no-]verbose] [--[no-](external-commands|aliases)]

Are these two new options mutually exclusive as this synopsis line
seems to indicate? Glancing at the code, it looks like they can be
used together. So, perhaps the synopsis should just say:

    'git help' [-a|--all] [--[no-]verbose] [--[no-]external-commands]
[--[no-]aliases]

> diff --git a/builtin/help.c b/builtin/help.c
> @@ -51,9 +51,14 @@ static const char *html_path;
>         OPT_CMDMODE('a', "all", &cmd_mode, N_("print all available commands"),
>                     HELP_ACTION_ALL),
> +       OPT_BOOL(0, "external-commands", &show_external_commands,
> +                N_("show external commands in --all?")),
> +       OPT_BOOL(0, "aliases", &show_aliases, N_("show aliases in --all?")),
>         OPT_HIDDEN_BOOL(0, "exclude-guides", &exclude_guides, N_("exclude guides")),

Nit: I don't see question marks on any of the existing options. It's
not clear what purpose they serve here.

> @@ -75,7 +80,7 @@ static struct option builtin_help_options[] = {
>  static const char * const builtin_help_usage[] = {
> -       N_("git help [-a|--all] [--[no-]verbose]]"),
> +       N_("git help [-a|--all] [--[no-]verbose]] [--[no-](external-commands|aliases)]"),

Same observation made above about mutual exclusion.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux