Re: [PATCH 1/5] doc: add documentation for OPT_STRING_LIST
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jan 12, 2017, 09:47 UTC
- Message-ID
- <alpine.DEB.2.20.1701121044120.3469@virtualbox>
- In-Reply-To
- <20170112001721.2534-2-jacob.e.keller@intel.com>
Hi Jake,
On Wed, 11 Jan 2017, Jacob Keller wrote:
Show 12 quoted lines
> diff --git a/Documentation/technical/api-parse-options.txt b/Documentation/technical/api-parse-options.txt > index 27bd701c0d68..15e876e4c804 100644 > --- a/Documentation/technical/api-parse-options.txt > +++ b/Documentation/technical/api-parse-options.txt > @@ -168,6 +168,11 @@ There are some macros to easily define options: > Introduce an option with string argument. > The string argument is put into `str_var`. > > +`OPT_STRING_LIST(short, long, &list, arg_str, description)`:: > + Introduce an option with a string argument. Repeated invocations > + accumulate into a list of strings. Reset and clear the list with > + `--no-option`.
One suggestions: as the list parameter is not type-safe (apart from checking that it can be cast to a `void *`), it would be good to mention in the documentation that `list` must be of type `struct string_list`.
I was about to suggest that `--no-option` may be misleading, as the command-line option is not really called `--option` in almost all cases, but I see that the rest of that document uses that convention to refer to the negated option already...
Ciao, Dscho