Explain how to include spaces in list of arguments

This commit is contained in:
Blake-Madden 2025-07-15 19:48:01 -04:00 committed by GitHub
parent 44380e5a44
commit 003b4a4dcf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 2 deletions

View File

@ -195,14 +195,23 @@ therefore, `-o false` does not work.
Parsing a list of values into a `std::vector<T>` is also supported, as long as `T`
can be parsed. To separate single values in a list the define symbol `CXXOPTS_VECTOR_DELIMITER`
is used, which is ',' by default. Ensure that you use no whitespaces between values because
those would be interpreted as the next command line option. Example for a command line option
is used, which is ',' by default. Ensure that you use no whitespaces between values
(unless the entire list is double quoted) because those would be interpreted as the
next command line option. Example for a command line option
that can be parsed as a `std::vector<double>`:
~~~
--my_list=1,-2.1,3,4.5
~~~
If the list of values is quoted, then spaces can be included. For example:
~~~
--my_list="review,memory sanitize,build help,reformat"
~~~
This will be parsed into `review`, `memory sanitize`, `build help`, and `reformat`.
## Options specified multiple times
The same option can be specified several times, with different arguments, which will all