Re: [PATCH v6 2/6] reset: introduce show-new-head-line option
- From
Thomas Gummerer <t.gummerer@gmail.com>
- Date
- Apr 2, 2018, 22:20 UTC
- Message-ID
- <20180402222016.GI2629@hank>
- In-Reply-To
- <xmqqwoxpxsfv.fsf@gitster-ct.c.googlers.com>
On 04/02, Junio C Hamano wrote:
> This is completely offtopic tangent, but I wonder how hidden-bool or > hidden options[] element in general interacts with the recent > addition of helping command line completion. Are we already doing > the right thing?
I had a quick look at this, and it looks like we're doing the right thing here. The following snipped from the 'show_gitcomp' function in parse-options.c:
Show 7 quoted lines
> for (; opts->type != OPTION_END; opts++) {
> const char *suffix = "";
>
> if (!opts->long_name)
> continue;
> if (opts->flags & (PARSE_OPT_HIDDEN | PARSE_OPT_NOCOMPLETE))
> continue;So if the PARSE_OPT_HIDDEN flag is given, we skip printing the option, which seems like the right thing to do.