Re: [PATCH v2 02/12] api-parse-options.adoc: document per-option flags
On Sat, Aug 8, 2026 at 9:25 AM Elijah Newren <newren@gmail.com> wrote:
>
> On Tue, Aug 4, 2026 at 3:04 AM Christian Couder
> <christian.couder@gmail.com> wrote:
Show 21 quoted lines
> > +`PARSE_OPT_LASTARG_DEFAULT`::
> > + Use the default value (`defval`) when the option is used
> > + without an argument, even for an option that normally requires
> > + one. Only the last argument on the command line takes effect.
>
> Is this accurate? Sufficiently precise? parse-options.h says
>
> * PARSE_OPT_LASTARG_DEFAULT: says that this option will take the default
> * value if no argument is given when the option
> * is last on the command line. If the option is
> * not last it will require an argument.
> * Should not be used with PARSE_OPT_OPTARG.
>
> If you want to reword that, maybe something like:
>
> The no-argument form is only accepted when the option is the
> last token on the command line; used earlier, it still
> requires an argument. Should not be combined with
> `PARSE_OPT_OPTARG`.
>
> ?
Yeah, in the v3 I will send soon, I have reworded it like you suggested.
Thanks.