Re: [PATCH] name-rev: use OPT_HIDDEN_BOOL for --peel-tag
- From
Jeff King <peff@peff.net>
- Date
- Sep 5, 2023, 07:17 UTC
- Message-ID
- <20230905071719.GF199565@coredump.intra.peff.net>
- In-Reply-To
- <5a86c8f8-fcdc-fee9-8af5-aa5ecb036d2e@web.de>
On Sat, Sep 02, 2023 at 08:38:34PM +0200, René Scharfe wrote:
Show 6 quoted lines
> adfc1857bd (describe: fix --contains when a tag is given as input, > 2013-07-18) added the option --peel-tag, defining it using a positional > struct option initializer and a comment indicating that it's intended to > be a hidden OPT_BOOL. 4741edd549 (Remove deprecated OPTION_BOOLEAN for > parsing arguments, 2013-08-03) added the macro OPT_HIDDEN_BOOL, which > allows to express this more succinctly. Use it.
Yeah, this is a definite improvement.
OPT_HIDDEN_BOOL() itself is a little funny to me. I guess back then we did not have the "_F" variants, but really it is just:
OPT_BOOL_F(0, "peel-tag", &peel_tag,
N_("dereference tags in the input (internal use)")),
PARSE_OPT_HIDDEN);which would remove one more special case (after all, being hidden is orthogonal to the type). But there are enough of them that maybe having a special name for this is worth it. I dunno. But we could probably simplify the definition, at least. :)
-Peff