Re: [PATCH v2 02/12] api-parse-options.adoc: document per-option flags
Christian Couder <[email protected]>
| Newsgroups | org.kernel.vger.git |
|---|---|
| Message-ID | <CAP8UFD0usk3kMW-qztB0jokexBnOGtmjH8Se3a2k6nkCP_qdsQ@mail.gmail.com> |
On Sat, Aug 8, 2026 at 9:25 AM Elijah Newren <[email protected]> wrote: > > On Tue, Aug 4, 2026 at 3:04 AM Christian Couder > <[email protected]> wrote: > > +`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.