Re: [PATCH] parse-options: document automatic PARSE_OPT_LITERAL_ARGHELP
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Jan 19, 2022, 14:41 UTC
- Message-ID
- <220119.867davokff.gmgdl@evledraar.gmail.com>
- In-Reply-To
- <ba624c59-5330-360e-dc4a-432752d22fc1@web.de>
On Wed, Jan 19 2022, René Scharfe wrote:
Show 21 quoted lines
> The help strings for arguments are enclosed in angle brackets > automatically. E.g. if argh is specified as "name", "--option <name>" > is printed, to indicate that users need to supply an actual name. The > flag PARSE_OPT_LITERAL_ARGHELP turns this off, so that "--option name" > is printed instead, to indicate that the literal string needs to be > supplied -- a rare case. > > This flag is enabled automatically if argh contains special characters > like brackets. The developer is supposed to provide any required angle > brackets for more complicated cases. E.g. if argh is "<start>,<end>" > then "--option <start>,<end>" is printed. > > Add a comment to mention this PARSE_OPT_LITERAL_ARGHELP behavior. > > Also remove the flag from option definitions for which it's inferred > automatically. > > Signed-off-by: René Scharfe <l.s.r@web.de> > --- > Somehow I feel this is not enough, but I can't pin down what's > missing.
Rather than just remove the flag from {am,push}.c and document this it would be better to add it to the optbug() checks in parse_options_check().
That way we'll ensure that these flags won't be redunantly specified, if we care enough...