Re: [PATCH 7/9] completion: drop the hard coded list of config vars
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- May 11, 2018, 22:47 UTC
- Message-ID
- <CAPig+cSndzXM+FD4bD5axn-QxOjowycDtD_JOoa4ra3sdnWXFQ@mail.gmail.com>
- In-Reply-To
- <20180510141927.23590-8-pclouds@gmail.com>
On Thu, May 10, 2018 at 10:19 AM Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:
> The new help option --config-for-completion is a machine friendlier > version of --config where all the placeholders and wildcards are > dropped, leaving only the good, completable prefixes for > git-completion.bash to consume.
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> > --- > diff --git a/builtin/help.c b/builtin/help.c > @@ -446,9 +447,13 @@ int cmd_help(int argc, const char **argv, const char
*prefix)
Show 7 quoted lines
> + int for_human = show_config == 1;
> +
> + if (for_human)
> + setup_pager();
> + list_config_help(for_human);
> + if (for_human)
> + printf("\n%s\n", _("'git help config' for moreinformation"));
Simpler to read, perhaps:
if (!for_human)
list_config_help(0);
else {
setup_pager();
list_config_help(1);
printf(...);
}