Commit dd0d8e4fe729e5b1110232c7a5c9566dad884686

Authored by Henry Schreiner
Committed by GitHub
1 parent 6cc757f7

Bump version to 1.9.0 (#408)

* Bump version to 1.9.0

* Include CMake mention
.appveyor.yml
1   -version: 1.8.0.{build}
  1 +version: 1.9.0.{build}
2 2  
3 3 branches:
4 4 only:
... ...
.github/CONTRIBUTING.md
... ... @@ -68,4 +68,12 @@ yarn all-contributors add username code,bug
68 68  
69 69 ## For maintainers: Making a release
70 70  
71   -Remember to replace the emoji in the readme, being careful not to replace the ones in all-contributors.
  71 +Remember to replace the emoji in the readme, being careful not to replace the ones in all-contributors if any overlap.
  72 +
  73 +Steps:
  74 +* Update changelog if needed
  75 +* Update the version in `.appveyor.yml` and `include/CLI/Version.hpp`.
  76 +* Find and replace in README:
  77 + * Replace " ๐Ÿ†•" and "๐Ÿ†• " with "" (ignores the description line)
  78 + * Check for `\/\/$` (vi syntax) to catch leftover `// ๐Ÿ†•`
  79 + * Replace "๐Ÿšง" with "๐Ÿ†•" (manually ignore the description line)
... ...
CHANGELOG.md
... ... @@ -25,7 +25,7 @@ configuration options were added to facilitate a wider variety of apps. GCC
25 25 * Backend: File checking updates [#341][]
26 26 * Backend: Using pre-commit to format, checked in GitHub Actions [#336][]
27 27 * Backend: Clang-tidy checked again, CMake option now `CL11_CLANG_TIDY` [#390][]
28   -* Backend: Warning cleanup, more checks from klocwork [#350][], Effective C++ [#354][], clang-tidy [#360][], CUDA NVCC [#365][], cross compile [#373][], and sign conversion [#382][]
  28 +* Backend: Warning cleanup, more checks from klocwork [#350][], Effective C++ [#354][], clang-tidy [#360][], CUDA NVCC [#365][], cross compile [#373][], sign conversion [#382][], and cpplint [#400][]
29 29 * Docs: CLI11 Tutorial now hosted in the same repository [#304][], [#318][], [#374][]
30 30 * Bugfix: Fixed undefined behavior in `checked_multiply` [#290][]
31 31 * Bugfix: `->check()` was adding the name to the wrong validator [#320][]
... ... @@ -34,6 +34,7 @@ configuration options were added to facilitate a wider variety of apps. GCC
34 34 * Bugfix: Enum conversion no longer broken if stream operator added [#348][]
35 35 * Build: The meson build system supported [#299][]
36 36 * Build: GCC 4.7 is no longer supported, due mostly to GoogleTest. GCC 4.8+ is now required. [#160][]
  37 +* Build: Restructured significant portions of CMake build system [#394][]
37 38  
38 39 > ### Converting from CLI11 1.8:
39 40 >
... ... @@ -77,6 +78,8 @@ configuration options were added to facilitate a wider variety of apps. GCC
77 78 [#374]: https://github.com/CLIUtils/CLI11/pull/374
78 79 [#382]: https://github.com/CLIUtils/CLI11/pull/382
79 80 [#390]: https://github.com/CLIUtils/CLI11/pull/390
  81 +[#394]: https://github.com/CLIUtils/CLI11/pull/394
  82 +[#400]: https://github.com/CLIUtils/CLI11/pull/400
80 83  
81 84  
82 85 ## Version 1.8: Transformers, default strings, and flags
... ...
README.md
... ... @@ -34,15 +34,15 @@ CLI11 is a command line parser for C++11 and beyond that provides a rich feature
34 34 - [Option types](#option-types)
35 35 - [Example](#example)
36 36 - [Option options](#option-options)
37   - - [Validators](#validators) ๐Ÿ†•
38   - - [Transforming Validators](#transforming-validators) ๐Ÿ†•
39   - - [Validator operations](#validator-operations) ๐Ÿ†•
40   - - [Custom Validators](#custom-validators) ๐Ÿ†•
41   - - [Querying Validators](#querying-validators) ๐Ÿ†•
42   - - [Getting Results](#getting-results) ๐Ÿ†•
  37 + - [Validators](#validators)
  38 + - [Transforming Validators](#transforming-validators)
  39 + - [Validator operations](#validator-operations)
  40 + - [Custom Validators](#custom-validators)
  41 + - [Querying Validators](#querying-validators)
  42 + - [Getting Results](#getting-results)
43 43 - [Subcommands](#subcommands)
44 44 - [Subcommand options](#subcommand-options)
45   - - [Option groups](#option-groups) ๐Ÿ†•
  45 + - [Option groups](#option-groups)
46 46 - [Callbacks](#callbacks)
47 47 - [Configuration file](#configuration-file)
48 48 - [Inheriting defaults](#inheriting-defaults)
... ... @@ -83,7 +83,7 @@ An acceptable CLI parser library should be all of the following:
83 83 - Easy to execute, with help, parse errors, etc. providing correct exit and details.
84 84 - Easy to extend as part of a framework that provides "applications" to users.
85 85 - Usable subcommand syntax, with support for multiple subcommands, nested subcommands, option groups, and optional fallthrough (explained later).
86   -- Ability to add a configuration file (`ini` or `TOML`๐Ÿšง format), and produce it as well.
  86 +- Ability to add a configuration file (`ini` or `TOML`๐Ÿ†• format), and produce it as well.
87 87 - Produce real values that can be used directly in code, not something you have pay compute time to look up, for HPC applications.
88 88 - Work with standard types, simple custom types, and extensible to exotic types.
89 89 - Permissively licensed.
... ... @@ -192,18 +192,18 @@ While all options internally are the same type, there are several ways to add an
192 192  
193 193 ```cpp
194 194 // Add options
195   -app.add_option(option_name, help_str="") // ๐Ÿ†•
  195 +app.add_option(option_name, help_str="")
196 196  
197 197 app.add_option(option_name,
198   - variable_to_bind_to, // bool, int, float, vector, ๐Ÿ†• enum, or string-like, or anything with a defined conversion from a string or that takes an int ๐Ÿšง, double ๐Ÿšง, or string in a constructor. Also allowed are tuples ๐Ÿšง, std::array ๐Ÿšง or std::pair ๐Ÿšง.
  198 + variable_to_bind_to, // bool, int, float, vector, enum, or string-like, or anything with a defined conversion from a string or that takes an int ๐Ÿ†•, double ๐Ÿ†•, or string in a constructor. Also allowed are tuples ๐Ÿ†•, std::array ๐Ÿ†• or std::pair ๐Ÿ†•.
199 199 help_string="")
200 200  
201 201 app.add_option_function<type>(option_name,
202   - function <void(const type &value)>, // ๐Ÿ†• type can be any type supported by add_option
  202 + function <void(const type &value)>, // type can be any type supported by add_option
203 203 help_string="")
204 204  
205 205 app.add_complex(... // Special case: support for complex numbers
206   -// ๐Ÿšง There is a template overload which takes two template parameters the first is the type of object to assign the value to, the second is the conversion type. The conversion type should have a known way to convert from a string, such as any of the types that work in the non-template version. If XC is a std::pair and T is some non pair type. Then a two argument constructor for T is called to assign the value. For tuples or other multi element types, XC must be a single type or a tuple like object of the same size as the assignment type
  206 +// ๐Ÿ†• There is a template overload which takes two template parameters the first is the type of object to assign the value to, the second is the conversion type. The conversion type should have a known way to convert from a string, such as any of the types that work in the non-template version. If XC is a std::pair and T is some non pair type. Then a two argument constructor for T is called to assign the value. For tuples or other multi element types, XC must be a single type or a tuple like object of the same size as the assignment type
207 207 app.add_option<typename T, typename XC>(option_name,
208 208 T &output, // output must be assignable or constructible from a value of type XC
209 209 help_string="")
... ... @@ -213,26 +213,26 @@ app.add_flag(option_name,
213 213 help_string="")
214 214  
215 215 app.add_flag(option_name,
216   - variable_to_bind_to, // bool, int, ๐Ÿ†• float, ๐Ÿ†• vector, ๐Ÿ†• enum, or ๐Ÿ†• string-like, or ๐Ÿ†• any singular object with a defined conversion from a string like add_option
  216 + variable_to_bind_to, // bool, int, float, vector, enum, or string-like, or any singular object with a defined conversion from a string like add_option
217 217 help_string="")
218 218  
219   -app.add_flag_function(option_name, // ๐Ÿ†•
  219 +app.add_flag_function(option_name,
220 220 function <void(int64_t count)>,
221 221 help_string="")
222 222  
223   -app.add_flag_callback(option_name,function<void(void)>,help_string="") // ๐Ÿ†•
  223 +app.add_flag_callback(option_name,function<void(void)>,help_string="")
224 224  
225 225 // Add subcommands
226 226 App* subcom = app.add_subcommand(name, description);
227 227  
228   -Option_group *app.add_option_group(name,description); // ๐Ÿ†•
  228 +Option_group *app.add_option_group(name,description);
229 229 ```
230 230  
231   -An option name must start with a alphabetic character, underscore, a number ๐Ÿ†•, '?' ๐Ÿ†•, or '@' ๐Ÿ†•. For long options, after the first character '.', and '-' are also valid characters. For the `add_flag*` functions '{' has special meaning. Names are given as a comma separated string, with the dash or dashes. An option or flag can have as many names as you want, and afterward, using `count`, you can use any of the names, with dashes as needed, to count the options. One of the names is allowed to be given without proceeding dash(es); if present the option is a positional option, and that name will be used on the help line for its positional form.
  231 +An option name must start with a alphabetic character, underscore, a number, '?', or '@'. For long options, after the first character '.', and '-' are also valid characters. For the `add_flag*` functions '{' has special meaning. Names are given as a comma separated string, with the dash or dashes. An option or flag can have as many names as you want, and afterward, using `count`, you can use any of the names, with dashes as needed, to count the options. One of the names is allowed to be given without proceeding dash(es); if present the option is a positional option, and that name will be used on the help line for its positional form.
232 232  
233 233 The `add_option_function<type>(...` function will typically require the template parameter be given unless a `std::function` object with an exact match is passed. The type can be any type supported by the `add_option` function. The function should throw an error (`CLI::ConversionError` or `CLI::ValidationError` possibly) if the value is not valid.
234 234  
235   -๐Ÿšง The two parameter template overload can be used in cases where you want to restrict the input such as
  235 +๐Ÿ†• The two parameter template overload can be used in cases where you want to restrict the input such as
236 236 ```
237 237 double val
238 238 app.add_option<double,unsigned int>("-v",val);
... ... @@ -258,10 +258,10 @@ would load a vector of doubles but ensure all values can be represented as integ
258 258  
259 259 Automatic direct capture of the default string is disabled when using the two parameter template. Use `set_default_str(...)` or `->default_function(std::string())` to set the default string or capture function directly for these cases.
260 260  
261   -๐Ÿ†• Flag options specified through the `add_flag*` functions allow a syntax for the option names to default particular options to a false value or any other value if some flags are passed. For example:
  261 +Flag options specified through the `add_flag*` functions allow a syntax for the option names to default particular options to a false value or any other value if some flags are passed. For example:
262 262  
263 263 ```cpp
264   -app.add_flag("--flag,!--no-flag",result,"help for flag"); // ๐Ÿ†•
  264 +app.add_flag("--flag,!--no-flag",result,"help for flag");
265 265 ```
266 266  
267 267 specifies that if `--flag` is passed on the command line result will be true or contain a value of 1. If `--no-flag` is
... ... @@ -273,7 +273,7 @@ all the given arguments and return the result. This can be modified if needed b
273 273 The default value can be any value. For example if you wished to define a numerical flag:
274 274  
275 275 ```cpp
276   -app.add_flag("-1{1},-2{2},-3{3}",result,"numerical flag") // ๐Ÿ†•
  276 +app.add_flag("-1{1},-2{2},-3{3}",result,"numerical flag")
277 277 ```
278 278  
279 279 using any of those flags on the command line will result in the specified number in the output. Similar things can be done for string values, and enumerations, as long as the default value can be converted to the given type.
... ... @@ -305,21 +305,21 @@ Before parsing, you can set the following options:
305 305 - `->group(name)`: The help group to put the option in. No effect for positional options. Defaults to `"Options"`. `""` will not show up in the help print (hidden).
306 306 - `->ignore_case()`: Ignore the case on the command line (also works on subcommands, does not affect arguments).
307 307 - `->ignore_underscore()`: Ignore any underscores in the options names (also works on subcommands, does not affect arguments). For example "option_one" will match with "optionone". This does not apply to short form options since they only have one character
308   -- `->disable_flag_override()`: ๐Ÿ†• From the command line long form flag options can be assigned a value on the command line using the `=` notation `--flag=value`. If this behavior is not desired, the `disable_flag_override()` disables it and will generate an exception if it is done on the command line. The `=` does not work with short form flag options.
309   -- `->delimiter(char)`: ๐Ÿ†• allows specification of a custom delimiter for separating single arguments into vector arguments, for example specifying `->delimiter(',')` on an option would result in `--opt=1,2,3` producing 3 elements of a vector and the equivalent of --opt 1 2 3 assuming opt is a vector value.
  308 +- `->disable_flag_override()`: From the command line long form flag options can be assigned a value on the command line using the `=` notation `--flag=value`. If this behavior is not desired, the `disable_flag_override()` disables it and will generate an exception if it is done on the command line. The `=` does not work with short form flag options.
  309 +- `->delimiter(char)`: Allows specification of a custom delimiter for separating single arguments into vector arguments, for example specifying `->delimiter(',')` on an option would result in `--opt=1,2,3` producing 3 elements of a vector and the equivalent of --opt 1 2 3 assuming opt is a vector value.
310 310 - `->description(str)`: Set/change the description.
311 311 - `->multi_option_policy(CLI::MultiOptionPolicy::Throw)`: Set the multi-option policy. Shortcuts available: `->take_last()`, `->take_first()`, and `->join()`. This will only affect options expecting 1 argument or bool flags (which do not inherit their default but always start with a specific policy).
312   -- `->check(std::string(const std::string &), validator_name="",validator_description="")`: ๐Ÿ†• Define a check function. The function should return a non empty string with the error message if the check fails
313   -- `->check(Validator)`: ๐Ÿ†• Use a Validator object to do the check see [Validators](#validators) for a description of available Validators and how to create new ones.
  312 +- `->check(std::string(const std::string &), validator_name="",validator_description="")`: Define a check function. The function should return a non empty string with the error message if the check fails
  313 +- `->check(Validator)`: Use a Validator object to do the check see [Validators](#validators) for a description of available Validators and how to create new ones.
314 314 - `->transform(std::string(std::string &), validator_name="",validator_description=")`: Converts the input string into the output string, in-place in the parsed options.
315   -- `->transform(Validator)`: uses a Validator object to do the transformation see [Validators](#validators) for a description of available Validators and how to create new ones.
  315 +- `->transform(Validator)`: Uses a Validator object to do the transformation see [Validators](#validators) for a description of available Validators and how to create new ones.
316 316 - `->each(void(const std::string &)>`: Run this function on each value received, as it is received. It should throw a `ValidationError` if an error is encountered.
317 317 - `->configurable(false)`: Disable this option from being in a configuration file.
318   - `->capture_default_str()`: ๐Ÿ†• Store the current value attached and display it in the help string.
319   -- `->default_function(std::string())`: ๐Ÿ†• Advanced: Change the function that `capture_default_str()` uses.
320   -- `->always_capture_default()`: ๐Ÿ†• Always run `capture_default_str()` when creating new options. Only useful on an App's `option_defaults`.
  318 + `->capture_default_str()`: Store the current value attached and display it in the help string.
  319 +- `->default_function(std::string())`: Advanced: Change the function that `capture_default_str()` uses.
  320 +- `->always_capture_default()`: Always run `capture_default_str()` when creating new options. Only useful on an App's `option_defaults`.
321 321 - `default_str(string)`: Set the default string directly. This string will also be used as a default value if no arguments are passed and the value is requested.
322   -- `default_val(value)`: ๐Ÿšง Generate the default string from a value and validate that the value is also valid. For options that assign directly to a value type the value in that type is also updated. Value must be convertible to a string(one of known types or a stream operator).
  322 +- `default_val(value)`: ๐Ÿ†• Generate the default string from a value and validate that the value is also valid. For options that assign directly to a value type the value in that type is also updated. Value must be convertible to a string(one of known types or a stream operator).
323 323  
324 324  
325 325 These options return the `Option` pointer, so you can chain them together, and even skip storing the pointer entirely. The `each` function takes any function that has the signature `void(const std::string&)`; it should throw a `ValidationError` when validation fails. The help message will have the name of the parent option prepended. Since `each`, `check` and `transform` use the same underlying mechanism, you can chain as many as you want, and they will be executed in order. Operations added through `transform` are executed first in reverse order of addition, and `check` and `each` are run following the transform functions in order of addition. If you just want to see the unconverted values, use `.results()` to get the `std::vector<std::string>` of results.
... ... @@ -332,7 +332,7 @@ On the command line, options can be given as:
332 332 - `-ffilename` (no space required)
333 333 - `-abcf filename` (flags and option can be combined)
334 334 - `--long` (long flag)
335   -- `--long_flag=true` (long flag with equals to override default value) ๐Ÿ†•
  335 +- `--long_flag=true` (long flag with equals to override default value)
336 336 - `--file filename` (space)
337 337 - `--file=filename` (equals)
338 338  
... ... @@ -342,14 +342,14 @@ If `allow_windows_style_options()` is specified in the application or subcommand
342 342 - `/long` (long flag)
343 343 - `/file filename` (space)
344 344 - `/file:filename` (colon)
345   -- `/long_flag:false` (long flag with : to override the default value) ๐Ÿ†•
  345 +- `/long_flag:false` (long flag with : to override the default value)
346 346 = Windows style options do not allow combining short options or values not separated from the short option like with `-` options
347 347  
348   -๐Ÿ†• Long flag options may be given with an `=<value>` to allow specifying a false value, or some other value to the flag. See [config files](#configuration-file) for details on the values supported. NOTE: only the `=` or `:` for windows-style options may be used for this, using a space will result in the argument being interpreted as a positional argument. This syntax can override the default values, and can be disabled by using `disable_flag_override()`.
  348 +Long flag options may be given with an `=<value>` to allow specifying a false value, or some other value to the flag. See [config files](#configuration-file) for details on the values supported. NOTE: only the `=` or `:` for windows-style options may be used for this, using a space will result in the argument being interpreted as a positional argument. This syntax can override the default values, and can be disabled by using `disable_flag_override()`.
349 349  
350 350 Extra positional arguments will cause the program to exit, so at least one positional option with a vector is recommended if you want to allow extraneous arguments.
351 351 If you set `.allow_extras()` on the main `App`, you will not get an error. You can access the missing options using `remaining` (if you have subcommands, `app.remaining(true)` will get all remaining options, subcommands included).
352   -If the remaining arguments are to processed by another `App` then the function `remaining_for_passthrough()` ๐Ÿ†• can be used to get the remaining arguments in reverse order such that `app.parse(vector)` works directly and could even be used inside a subcommand callback.
  352 +If the remaining arguments are to processed by another `App` then the function `remaining_for_passthrough()` can be used to get the remaining arguments in reverse order such that `app.parse(vector)` works directly and could even be used inside a subcommand callback.
353 353  
354 354 You can access a vector of pointers to the parsed options in the original order using `parse_order()`.
355 355 If `--` is present in the command line that does not end an unlimited option, then
... ... @@ -360,21 +360,21 @@ Validators are structures to check or modify inputs, they can be used to verify
360 360  
361 361 CLI11 has several Validators built-in that perform some common checks
362 362  
363   -- `CLI::IsMember(...)`: ๐Ÿ†• Require an option be a member of a given set. See [Transforming Validators](#transforming-validators) for more details.
364   -- `CLI::Transformer(...)`: ๐Ÿ†• Modify the input using a map. See [Transforming Validators](#transforming-validators) for more details.
365   -- `CLI::CheckedTransformer(...)`: ๐Ÿ†• Modify the input using a map, and require that the input is either in the set or already one of the outputs of the set. See [Transforming Validators](#transforming-validators) for more details.
366   -- `CLI::AsNumberWithUnit(...)`: ๐Ÿ†• Modify the `<NUMBER> <UNIT>` pair by matching the unit and multiplying the number by the corresponding factor. It can be used as a base for transformers, that accept things like size values (`1 KB`) or durations (`0.33 ms`).
367   -- `CLI::AsSizeValue(...)`: ๐Ÿ†• Convert inputs like `100b`, `42 KB`, `101 Mb`, `11 Mib` to absolute values. `KB` can be configured to be interpreted as 10^3 or 2^10.
  363 +- `CLI::IsMember(...)`: Require an option be a member of a given set. See [Transforming Validators](#transforming-validators) for more details.
  364 +- `CLI::Transformer(...)`: Modify the input using a map. See [Transforming Validators](#transforming-validators) for more details.
  365 +- `CLI::CheckedTransformer(...)`: Modify the input using a map, and require that the input is either in the set or already one of the outputs of the set. See [Transforming Validators](#transforming-validators) for more details.
  366 +- `CLI::AsNumberWithUnit(...)`: Modify the `<NUMBER> <UNIT>` pair by matching the unit and multiplying the number by the corresponding factor. It can be used as a base for transformers, that accept things like size values (`1 KB`) or durations (`0.33 ms`).
  367 +- `CLI::AsSizeValue(...)`: Convert inputs like `100b`, `42 KB`, `101 Mb`, `11 Mib` to absolute values. `KB` can be configured to be interpreted as 10^3 or 2^10.
368 368 - `CLI::ExistingFile`: Requires that the file exists if given.
369 369 - `CLI::ExistingDirectory`: Requires that the directory exists.
370 370 - `CLI::ExistingPath`: Requires that the path (file or directory) exists.
371 371 - `CLI::NonexistentPath`: Requires that the path does not exist.
372 372 - `CLI::Range(min,max)`: Requires that the option be between min and max (make sure to use floating point if needed). Min defaults to 0.
373   -- `CLI::Bounded(min,max)`: ๐Ÿ†• Modify the input such that it is always between min and max (make sure to use floating point if needed). Min defaults to 0. Will produce an error if conversion is not possible.
374   -- `CLI::PositiveNumber`: ๐Ÿ†• Requires the number be greater than 0
375   -- `CLI::NonNegativeNumber`: ๐Ÿ†• Requires the number be greater or equal to 0
376   -- `CLI::Number`: ๐Ÿ†• Requires the input be a number.
377   -- `CLI::ValidIPV4`: ๐Ÿ†• Requires that the option be a valid IPv4 string e.g. `'255.255.255.255'`, `'10.1.1.7'`.
  373 +- `CLI::Bounded(min,max)`: Modify the input such that it is always between min and max (make sure to use floating point if needed). Min defaults to 0. Will produce an error if conversion is not possible.
  374 +- `CLI::PositiveNumber`: Requires the number be greater than 0
  375 +- `CLI::NonNegativeNumber`: Requires the number be greater or equal to 0
  376 +- `CLI::Number`: Requires the input be a number.
  377 +- `CLI::ValidIPV4`: Requires that the option be a valid IPv4 string e.g. `'255.255.255.255'`, `'10.1.1.7'`.
378 378  
379 379 These Validators can be used by simply passing the name into the `check` or `transform` methods on an option
380 380  
... ... @@ -383,7 +383,7 @@ These Validators can be used by simply passing the name into the `check` or `tra
383 383 ->check(CLI::Range(0,10));
384 384 ```
385 385  
386   -Validators can be merged using `&` and `|` and inverted using `!` ๐Ÿ†•. For example:
  386 +Validators can be merged using `&` and `|` and inverted using `!`. For example:
387 387  
388 388 ```cpp
389 389 ->check(CLI::Range(0,10)|CLI::Range(20,30));
... ... @@ -399,8 +399,8 @@ will produce a check for a number less than or equal to 0.
399 399  
400 400 ##### Transforming Validators
401 401 There are a few built in Validators that let you transform values if used with the `transform` function. If they also do some checks then they can be used `check` but some may do nothing in that case.
402   -- ๐Ÿ†• `CLI::Bounded(min,max)` will bound values between min and max and values outside of that range are limited to min or max, it will fail if the value cannot be converted and produce a `ValidationError`
403   -- ๐Ÿ†• The `IsMember` Validator lets you specify a set of predefined options. You can pass any container or copyable pointer (including `std::shared_ptr`) to a container to this Validator; the container just needs to be iterable and have a `::value_type`. The key type should be convertible from a string, You can use an initializer list directly if you like. If you need to modify the set later, the pointer form lets you do that; the type message and check will correctly refer to the current version of the set. The container passed in can be a set, vector, or a map like structure. If used in the `transform` method the output value will be the matching key as it could be modified by filters.
  402 +- `CLI::Bounded(min,max)` will bound values between min and max and values outside of that range are limited to min or max, it will fail if the value cannot be converted and produce a `ValidationError`
  403 +- The `IsMember` Validator lets you specify a set of predefined options. You can pass any container or copyable pointer (including `std::shared_ptr`) to a container to this Validator; the container just needs to be iterable and have a `::value_type`. The key type should be convertible from a string, You can use an initializer list directly if you like. If you need to modify the set later, the pointer form lets you do that; the type message and check will correctly refer to the current version of the set. The container passed in can be a set, vector, or a map like structure. If used in the `transform` method the output value will be the matching key as it could be modified by filters.
404 404 After specifying a set of options, you can also specify "filter" functions of the form `T(T)`, where `T` is the type of the values. The most common choices probably will be `CLI::ignore_case` an `CLI::ignore_underscore`, and `CLI::ignore_space`. These all work on strings but it is possible to define functions that work on other types.
405 405 Here are some examples
406 406 of `IsMember`:
... ... @@ -410,7 +410,7 @@ of `IsMember`:
410 410 - `CLI::IsMember(std::set<int>({2,3,4}))`: Most containers and types work; you just need `std::begin`, `std::end`, and `::value_type`.
411 411 - `CLI::IsMember(std::map<std::string, TYPE>({{"one", 1}, {"two", 2}}))`: You can use maps; in `->transform()` these replace the matched value with the matched key. The value member of the map is not used in `IsMember`, so it can be any type.
412 412 - `auto p = std::make_shared<std::vector<std::string>>(std::initializer_list<std::string>("one", "two")); CLI::IsMember(p)`: You can modify `p` later.
413   -- ๐Ÿ†• The `Transformer` and `CheckedTransformer` Validators transform one value into another. Any container or copyable pointer (including `std::shared_ptr`) to a container that generates pairs of values can be passed to these `Validator's`; the container just needs to be iterable and have a `::value_type` that consists of pairs. The key type should be convertible from a string, and the value type should be convertible to a string You can use an initializer list directly if you like. If you need to modify the map later, the pointer form lets you do that; the description message will correctly refer to the current version of the map. `Transformer` does not do any checking so values not in the map are ignored. `CheckedTransformer` takes an extra step of verifying that the value is either one of the map key values, in which case it is transformed, or one of the expected output values, and if not will generate a `ValidationError`. A Transformer placed using `check` will not do anything.
  413 +- The `Transformer` and `CheckedTransformer` Validators transform one value into another. Any container or copyable pointer (including `std::shared_ptr`) to a container that generates pairs of values can be passed to these `Validator's`; the container just needs to be iterable and have a `::value_type` that consists of pairs. The key type should be convertible from a string, and the value type should be convertible to a string You can use an initializer list directly if you like. If you need to modify the map later, the pointer form lets you do that; the description message will correctly refer to the current version of the map. `Transformer` does not do any checking so values not in the map are ignored. `CheckedTransformer` takes an extra step of verifying that the value is either one of the map key values, in which case it is transformed, or one of the expected output values, and if not will generate a `ValidationError`. A Transformer placed using `check` will not do anything.
414 414 After specifying a map of options, you can also specify "filter" just like in `CLI::IsMember`.
415 415 Here are some examples (`Transformer` and `CheckedTransformer` are interchangeable in the examples)
416 416 of `Transformer`:
... ... @@ -423,11 +423,11 @@ of `Transformer`:
423 423  
424 424 NOTES: If the container used in `IsMember`, `Transformer`, or `CheckedTransformer` has a `find` function like `std::unordered_map` or `std::map` then that function is used to do the searching. If it does not have a `find` function a linear search is performed. If there are filters present, the fast search is performed first, and if that fails a linear search with the filters on the key values is performed.
425 425  
426   -##### Validator operations ๐Ÿ†•
  426 +##### Validator operations
427 427 Validators are copyable and have a few operations that can be performed on them to alter settings. Most of the built in Validators have a default description that is displayed in the help. This can be altered via `.description(validator_description)`.
428 428 The name of a Validator, which is useful for later reference from the `get_validator(name)` method of an `Option` can be set via `.name(validator_name)`
429 429 The operation function of a Validator can be set via
430   -`.operation(std::function<std::string(std::string &>)`. The `.active()` function can activate or deactivate a Validator from the operation. A validator can be set to apply only to a specific element of the output. For example in a pair option `std::pair<int, std::string>` the first element may need to be a positive integer while the second may need to be a valid file. The `.application_index(int)` ๐Ÿšง function can specify this. It is zero based and negative indices apply to all values.
  430 +`.operation(std::function<std::string(std::string &>)`. The `.active()` function can activate or deactivate a Validator from the operation. A validator can be set to apply only to a specific element of the output. For example in a pair option `std::pair<int, std::string>` the first element may need to be a positive integer while the second may need to be a valid file. The `.application_index(int)` ๐Ÿ†• function can specify this. It is zero based and negative indices apply to all values.
431 431 ```cpp
432 432 opt->check(CLI::Validator(CLI::PositiveNumber).application_index(0));
433 433 opt->check(CLI::Validator(CLI::ExistingFile).application_index(1));
... ... @@ -446,7 +446,7 @@ The check can later be activated through
446 446 opt->get_validator("range")->active();
447 447 ```
448 448  
449   -##### Custom Validators ๐Ÿ†•
  449 +##### Custom Validators
450 450  
451 451 A validator object with a custom function can be created via
452 452  
... ... @@ -462,7 +462,7 @@ CLI::Validator(validator_description);
462 462  
463 463 It is also possible to create a subclass of `CLI::Validator`, in which case it can also set a custom description function, and operation function.
464 464  
465   -##### Querying Validators ๐Ÿ†•
  465 +##### Querying Validators
466 466  
467 467 Once loaded into an Option, a pointer to a named Validator can be retrieved via
468 468  
... ... @@ -472,7 +472,7 @@ opt-&gt;get_validator(name);
472 472  
473 473 This will retrieve a Validator with the given name or throw a `CLI::OptionNotFound` error. If no name is given or name is empty the first unnamed Validator will be returned or the first Validator if there is only one.
474 474  
475   -or ๐Ÿšง
  475 +or ๐Ÿ†•
476 476  
477 477 ```cpp
478 478 opt->get_validator(index);
... ... @@ -480,19 +480,19 @@ opt-&gt;get_validator(index);
480 480  
481 481 Which will return a validator in the index it is applied which isn't necessarily the order in which was defined. The pointer can be `nullptr` if an invalid index is given.
482 482 Validators have a few functions to query the current values
483   -- `get_description()`: ๐Ÿ†• Will return a description string
484   -- `get_name()`: ๐Ÿ†• Will return the Validator name
485   -- `get_active()`: ๐Ÿ†• Will return the current active state, true if the Validator is active.
486   -- `get_application_index()`: ๐Ÿšง Will return the current application index.
487   -- `get_modifying()`: ๐Ÿ†• Will return true if the Validator is allowed to modify the input, this can be controlled via the `non_modifying()` ๐Ÿ†• method, though it is recommended to let `check` and `transform` option methods manipulate it if needed.
  483 +- `get_description()`: Will return a description string
  484 +- `get_name()`: Will return the Validator name
  485 +- `get_active()`: Will return the current active state, true if the Validator is active.
  486 +- `get_application_index()`: ๐Ÿ†• Will return the current application index.
  487 +- `get_modifying()`: Will return true if the Validator is allowed to modify the input, this can be controlled via the `non_modifying()` method, though it is recommended to let `check` and `transform` option methods manipulate it if needed.
488 488  
489 489 #### Getting results
490 490  
491 491 In most cases, the fastest and easiest way is to return the results through a callback or variable specified in one of the `add_*` functions. But there are situations where this is not possible or desired. For these cases the results may be obtained through one of the following functions. Please note that these functions will do any type conversions and processing during the call so should not used in performance critical code:
492 492  
493 493 - `results()`: Retrieves a vector of strings with all the results in the order they were given.
494   -- `results(variable_to_bind_to)`: ๐Ÿ†• Gets the results according to the MultiOptionPolicy and converts them just like the `add_option_function` with a variable.
495   -- `Value=as<type>()`: ๐Ÿ†• Returns the result or default value directly as the specified type if possible, can be vector to return all results, and a non-vector to get the result according to the MultiOptionPolicy in place.
  494 +- `results(variable_to_bind_to)`: Gets the results according to the MultiOptionPolicy and converts them just like the `add_option_function` with a variable.
  495 +- `Value=as<type>()`: Returns the result or default value directly as the specified type if possible, can be vector to return all results, and a non-vector to get the result according to the MultiOptionPolicy in place.
496 496  
497 497 ### Subcommands
498 498  
... ... @@ -508,9 +508,9 @@ All `App`s have a `get_subcommands()` method, which returns a list of pointers t
508 508 For many cases, however, using an app's callback capabilities may be easier. Every app has a set of callbacks that can be executed at various stages of parsing; a `C++` lambda function (with capture to get parsed values) can be used as input to the callback definition function. If you throw `CLI::Success` or `CLI::RuntimeError(return_value)`, you can
509 509 even exit the program through the callback.
510 510  
511   -Multiple subcommands are allowed, to allow [`Click`][click] like series of commands (order is preserved). ๐Ÿ†• The same subcommand can be triggered multiple times but all positional arguments will take precedence over the second and future calls of the subcommand. `->count()` on the subcommand will return the number of times the subcommand was called. The subcommand callback will only be triggered once unless the `.immediate_callback()` ๐Ÿ†• flag is set or the callback is specified through the `parse_complete_callback()` function. The `final_callback()` is triggered only once. In which case the callback executes on completion of the subcommand arguments but after the arguments for that subcommand have been parsed, and can be triggered multiple times.
  511 +Multiple subcommands are allowed, to allow [`Click`][click] like series of commands (order is preserved). The same subcommand can be triggered multiple times but all positional arguments will take precedence over the second and future calls of the subcommand. `->count()` on the subcommand will return the number of times the subcommand was called. The subcommand callback will only be triggered once unless the `.immediate_callback()` flag is set or the callback is specified through the `parse_complete_callback()` function. The `final_callback()` is triggered only once. In which case the callback executes on completion of the subcommand arguments but after the arguments for that subcommand have been parsed, and can be triggered multiple times.
512 512  
513   -๐Ÿ†• Subcommands may also have an empty name either by calling `add_subcommand` with an empty string for the name or with no arguments.
  513 +Subcommands may also have an empty name either by calling `add_subcommand` with an empty string for the name or with no arguments.
514 514 Nameless subcommands function a similarly to groups in the main `App`. See [Option groups](#option-groups) to see how this might work. If an option is not defined in the main App, all nameless subcommands are checked as well. This allows for the options to be defined in a composable group. The `add_subcommand` function has an overload for adding a `shared_ptr<App>` so the subcommand(s) could be defined in different components and merged into a main `App`, or possibly multiple `Apps`. Multiple nameless subcommands are allowed. Callbacks for nameless subcommands are only triggered if any options from the subcommand were parsed.
515 515  
516 516 #### Subcommand options
... ... @@ -521,61 +521,61 @@ There are several options that are supported on the main app and subcommands and
521 521 - `.ignore_underscore()`: Ignore any underscores in the subcommand name. Inherited by added subcommands, so is usually used on the main `App`.
522 522 - `.allow_windows_style_options()`: Allow command line options to be parsed in the form of `/s /long /file:file_name.ext` This option does not change how options are specified in the `add_option` calls or the ability to process options in the form of `-s --long --file=file_name.ext`.
523 523 - `.fallthrough()`: Allow extra unmatched options and positionals to "fall through" and be matched on a parent option. Subcommands always are allowed to "fall through" as in they will first attempt to match on the current subcommand and if they fail will progressively check parents for matching subcommands.
524   -- `.configurable()`: ๐Ÿšง Allow the subcommand to be triggered from a configuration file. By default subcommand options in a configuration file do not trigger a subcommand but will just update default values.
525   -- `.disable()`: ๐Ÿ†• Specify that the subcommand is disabled, if given with a bool value it will enable or disable the subcommand or option group.
526   -- `.disabled_by_default()`: ๐Ÿ†• Specify that at the start of parsing the subcommand/option_group should be disabled. This is useful for allowing some Subcommands to trigger others.
527   -- `.enabled_by_default()`: ๐Ÿ†• Specify that at the start of each parse the subcommand/option_group should be enabled. This is useful for allowing some Subcommands to disable others.
528   -- `.validate_positionals()`: ๐Ÿ†• Specify that positionals should pass validation before matching. Validation is specified through `transform`, `check`, and `each` for an option. If an argument fails validation it is not an error and matching proceeds to the next available positional or extra arguments.
529   -- `.excludes(option_or_subcommand)`: ๐Ÿ†• If given an option pointer or pointer to another subcommand, these subcommands cannot be given together. In the case of options, if the option is passed the subcommand cannot be used and will generate an error.
530   -- `.needs(option_or_subcommand)`: ๐Ÿšง If given an option pointer or pointer to another subcommand, the subcommands will require the given option to have been given before this subcommand is validated which occurs prior to execution of any callback or after parsing is completed.
531   -- `.require_option()`: ๐Ÿ†• Require 1 or more options or option groups be used.
532   -- `.require_option(N)`: ๐Ÿ†• Require `N` options or option groups, if `N>0`, or up to `N` if `N<0`. `N=0` resets to the default to 0 or more.
533   -- `.require_option(min, max)`: ๐Ÿ†• Explicitly set min and max allowed options or option groups. Setting `max` to 0 implies unlimited options.
  524 +- `.configurable()`: ๐Ÿ†• Allow the subcommand to be triggered from a configuration file. By default subcommand options in a configuration file do not trigger a subcommand but will just update default values.
  525 +- `.disable()`: Specify that the subcommand is disabled, if given with a bool value it will enable or disable the subcommand or option group.
  526 +- `.disabled_by_default()`: Specify that at the start of parsing the subcommand/option_group should be disabled. This is useful for allowing some Subcommands to trigger others.
  527 +- `.enabled_by_default()`: Specify that at the start of each parse the subcommand/option_group should be enabled. This is useful for allowing some Subcommands to disable others.
  528 +- `.validate_positionals()`: Specify that positionals should pass validation before matching. Validation is specified through `transform`, `check`, and `each` for an option. If an argument fails validation it is not an error and matching proceeds to the next available positional or extra arguments.
  529 +- `.excludes(option_or_subcommand)`: If given an option pointer or pointer to another subcommand, these subcommands cannot be given together. In the case of options, if the option is passed the subcommand cannot be used and will generate an error.
  530 +- `.needs(option_or_subcommand)`: ๐Ÿ†• If given an option pointer or pointer to another subcommand, the subcommands will require the given option to have been given before this subcommand is validated which occurs prior to execution of any callback or after parsing is completed.
  531 +- `.require_option()`: Require 1 or more options or option groups be used.
  532 +- `.require_option(N)`: Require `N` options or option groups, if `N>0`, or up to `N` if `N<0`. `N=0` resets to the default to 0 or more.
  533 +- `.require_option(min, max)`: Explicitly set min and max allowed options or option groups. Setting `max` to 0 implies unlimited options.
534 534 - `.require_subcommand()`: Require 1 or more subcommands.
535 535 - `.require_subcommand(N)`: Require `N` subcommands if `N>0`, or up to `N` if `N<0`. `N=0` resets to the default to 0 or more.
536 536 - `.require_subcommand(min, max)`: Explicitly set min and max allowed subcommands. Setting `max` to 0 is unlimited.
537 537 - `.add_subcommand(name="", description="")`: Add a subcommand, returns a pointer to the internally stored subcommand.
538   -- `.add_subcommand(shared_ptr<App>)`: ๐Ÿ†• Add a subcommand by shared_ptr, returns a pointer to the internally stored subcommand.
539   -- `.remove_subcommand(App)`: ๐Ÿ†• Remove a subcommand from the app or subcommand.
  538 +- `.add_subcommand(shared_ptr<App>)`: Add a subcommand by shared_ptr, returns a pointer to the internally stored subcommand.
  539 +- `.remove_subcommand(App)`: Remove a subcommand from the app or subcommand.
540 540 - `.got_subcommand(App_or_name)`: Check to see if a subcommand was received on the command line.
541 541 - `.get_subcommands(filter)`: The list of subcommands that match a particular filter function.
542   -- `.add_option_group(name="", description="")`: ๐Ÿ†• Add an [option group](#option-groups) to an App, an option group is specialized subcommand intended for containing groups of options or other groups for controlling how options interact.
  542 +- `.add_option_group(name="", description="")`: Add an [option group](#option-groups) to an App, an option group is specialized subcommand intended for containing groups of options or other groups for controlling how options interact.
543 543 - `.get_parent()`: Get the parent App or `nullptr` if called on master App.
544 544 - `.get_option(name)`: Get an option pointer by option name will throw if the specified option is not available, nameless subcommands are also searched
545   -- `.get_option_no_throw(name)`: ๐Ÿ†• Get an option pointer by option name. This function will return a `nullptr` instead of throwing if the option is not available.
  545 +- `.get_option_no_throw(name)`: Get an option pointer by option name. This function will return a `nullptr` instead of throwing if the option is not available.
546 546 - `.get_options(filter)`: Get the list of all defined option pointers (useful for processing the app for custom output formats).
547 547 - `.parse_order()`: Get the list of option pointers in the order they were parsed (including duplicates).
548 548 - `.formatter(fmt)`: Set a formatter, with signature `std::string(const App*, std::string, AppFormatMode)`. See Formatting for more details.
549 549 - `.description(str)`: Set/change the description.
550 550 - `.get_description()`: Access the description.
551   -- `.alias(str)`: ๐Ÿšง set an alias for the subcommand, this allows subcommands to be called by more than one name.
  551 +- `.alias(str)`: ๐Ÿ†• set an alias for the subcommand, this allows subcommands to be called by more than one name.
552 552 - `.parsed()`: True if this subcommand was given on the command line.
553 553 - `.count()`: Returns the number of times the subcommand was called.
554 554 - `.count(option_name)`: Returns the number of times a particular option was called.
555   -- `.count_all()`: ๐Ÿ†• Returns the total number of arguments a particular subcommand processed, on the master App it returns the total number of processed commands.
  555 +- `.count_all()`: Returns the total number of arguments a particular subcommand processed, on the master App it returns the total number of processed commands.
556 556 - `.name(name)`: Add or change the name.
557   -- `.callback(void() function)`: Set the callback for an app. ๐Ÿšง either sets the pre_parse_callback or the final_callback depending on the value of `immediate_callback`. See [Subcommand callbacks](#callbacks) for some additional details.
558   -- `.parse_complete_callback(void() function)`: ๐Ÿšง Set the callback that runs at the completion of parsing. for subcommands this is executed at the completion of the single subcommand and can be executed multiple times. See [Subcommand callbacks](#callbacks) for some additional details.
559   -- `.final_callback(void() function)`: ๐Ÿšง Set the callback that runs at the end of all processing. This is the last thing that is executed before returning. See [Subcommand callbacks](#callbacks) for some additional details.
560   -- `.immediate_callback()`: ๐Ÿ†• Specifies whether the callback for a subcommand should be run as a `parse_complete_callback`(true) or `final_callback`(false). When used on the main app ๐Ÿšง it will execute the main app callback prior to the callbacks for a subcommand if they do not also have the `immediate_callback` flag set. ๐Ÿšง It is preferable to use the `parse_complete_callback` or `final_callback` directly instead of the `callback` and `immediate_callback` if one wishes to control the ordering and timing of callback. Though `immediate_callback` can be used to swap them if that is needed.
561   -- `.pre_parse_callback(void(std::size_t) function)`: ๐Ÿ†• Set a callback that executes after the first argument of an application is processed. See [Subcommand callbacks](#callbacks) for some additional details.
  557 +- `.callback(void() function)`: Set the callback for an app. ๐Ÿ†• either sets the pre_parse_callback or the final_callback depending on the value of `immediate_callback`. See [Subcommand callbacks](#callbacks) for some additional details.
  558 +- `.parse_complete_callback(void() function)`: ๐Ÿ†• Set the callback that runs at the completion of parsing. for subcommands this is executed at the completion of the single subcommand and can be executed multiple times. See [Subcommand callbacks](#callbacks) for some additional details.
  559 +- `.final_callback(void() function)`: ๐Ÿ†• Set the callback that runs at the end of all processing. This is the last thing that is executed before returning. See [Subcommand callbacks](#callbacks) for some additional details.
  560 +- `.immediate_callback()`: Specifies whether the callback for a subcommand should be run as a `parse_complete_callback`(true) or `final_callback`(false). When used on the main app ๐Ÿ†• it will execute the main app callback prior to the callbacks for a subcommand if they do not also have the `immediate_callback` flag set. ๐Ÿ†• It is preferable to use the `parse_complete_callback` or `final_callback` directly instead of the `callback` and `immediate_callback` if one wishes to control the ordering and timing of callback. Though `immediate_callback` can be used to swap them if that is needed.
  561 +- `.pre_parse_callback(void(std::size_t) function)`: Set a callback that executes after the first argument of an application is processed. See [Subcommand callbacks](#callbacks) for some additional details.
562 562 - `.allow_extras()`: Do not throw an error if extra arguments are left over.
563   -- `.positionals_at_end()`: ๐Ÿ†• Specify that positional arguments occur as the last arguments and throw an error if an unexpected positional is encountered.
  563 +- `.positionals_at_end()`: Specify that positional arguments occur as the last arguments and throw an error if an unexpected positional is encountered.
564 564 - `.prefix_command()`: Like `allow_extras`, but stop immediately on the first unrecognized item. It is ideal for allowing your app or subcommand to be a "prefix" to calling another app.
565 565 - `.footer(message)`: Set text to appear at the bottom of the help string.
566   -- `.footer(std::string())`: ๐Ÿšง Set a callback to generate a string that will appear at the end of the help string.
  566 +- `.footer(std::string())`: ๐Ÿ†• Set a callback to generate a string that will appear at the end of the help string.
567 567 - `.set_help_flag(name, message)`: Set the help flag name and message, returns a pointer to the created option.
568 568 - `.set_help_all_flag(name, message)`: Set the help all flag name and message, returns a pointer to the created option. Expands subcommands.
569 569 - `.failure_message(func)`: Set the failure message function. Two provided: `CLI::FailureMessage::help` and `CLI::FailureMessage::simple` (the default).
570 570 - `.group(name)`: Set a group name, defaults to `"Subcommands"`. Setting `""` will be hide the subcommand.
571   -- `[option_name]`: ๐Ÿ†• retrieve a const pointer to an option given by `option_name` for Example `app["--flag1"]` will get a pointer to the option for the "--flag1" value, `app["--flag1"]->as<bool>()` will get the results of the command line for a flag. The operation will throw an exception if the option name is not valid.
  571 +- `[option_name]`: retrieve a const pointer to an option given by `option_name` for Example `app["--flag1"]` will get a pointer to the option for the "--flag1" value, `app["--flag1"]->as<bool>()` will get the results of the command line for a flag. The operation will throw an exception if the option name is not valid.
572 572  
573 573 > Note: if you have a fixed number of required positional options, that will match before subcommand names. `{}` is an empty filter function, and any positional argument will match before repeated subcommand names.
574 574  
575 575  
576 576 #### Callbacks
577   -A subcommand has three optional callbacks that are executed at different stages of processing. The `preparse_callback` ๐Ÿ†• is executed once after the first argument of a subcommand or application is processed and gives an argument for the number of remaining arguments to process. For the main app the first argument is considered the program name, for subcommands the first argument is the subcommand name. For Option groups and nameless subcommands the first argument is after the first argument or subcommand is processed from that group.
578   -The second callback is executed after parsing. This is known as the `parse_complete_callback`. For subcommands this is executed immediately after parsing and can be executed multiple times if a subcommand is called multiple times. On the main app this callback is executed after all the `parse_complete_callback`s for the subcommands are executed but prior to any `final_callback` calls in the subcommand or option groups. If the main app or subcommand has a config file, no data from the config file will be reflected in `parse_complete_callback` on named subcommands ๐Ÿšง. For `option_group`s the `parse_complete_callback` is executed prior to the `parse_complete_callback` on the main app but after the `config_file` is loaded (if specified). The ๐Ÿšง `final_callback` is executed after all processing is complete. After the `parse_complete_callback` is executed on the main app, the used subcommand `final_callback` are executed followed by the "final callback" for option groups. The last thing to execute is the `final_callback` for the `main_app`.
  577 +A subcommand has three optional callbacks that are executed at different stages of processing. The `preparse_callback` is executed once after the first argument of a subcommand or application is processed and gives an argument for the number of remaining arguments to process. For the main app the first argument is considered the program name, for subcommands the first argument is the subcommand name. For Option groups and nameless subcommands the first argument is after the first argument or subcommand is processed from that group.
  578 +The second callback is executed after parsing. This is known as the `parse_complete_callback`. For subcommands this is executed immediately after parsing and can be executed multiple times if a subcommand is called multiple times. On the main app this callback is executed after all the `parse_complete_callback`s for the subcommands are executed but prior to any `final_callback` calls in the subcommand or option groups. If the main app or subcommand has a config file, no data from the config file will be reflected in `parse_complete_callback` on named subcommands ๐Ÿ†•. For `option_group`s the `parse_complete_callback` is executed prior to the `parse_complete_callback` on the main app but after the `config_file` is loaded (if specified). The ๐Ÿ†• `final_callback` is executed after all processing is complete. After the `parse_complete_callback` is executed on the main app, the used subcommand `final_callback` are executed followed by the "final callback" for option groups. The last thing to execute is the `final_callback` for the `main_app`.
579 579 For example say an application was set up like
580 580  
581 581 ```cpp
... ... @@ -614,7 +614,7 @@ Prior to executed a `parse_complete_callback` all contained options are processe
614 614  
615 615  
616 616  
617   -#### Option groups ๐Ÿ†•
  617 +#### Option groups
618 618  
619 619 The subcommand method
620 620  
... ... @@ -641,7 +641,7 @@ This results in the subcommand being moved from its parent into the option group
641 641 Options in an option group are searched for a command line match after any options in the main app, so any positionals in the main app would be matched first. So care must be taken to make sure of the order when using positional arguments and option groups.
642 642 Option groups work well with `excludes` and `require_options` methods, as an application will treat an option group as a single option for the purpose of counting and requirements, and an option group will be considered used if any of the options or subcommands contained in it are used. Option groups allow specifying requirements such as requiring 1 of 3 options in one group and 1 of 3 options in a different group. Option groups can contain other groups as well. Disabling an option group will turn off all options within the group.
643 643  
644   -The `CLI::TriggerOn` ๐Ÿ†• and `CLI::TriggerOff` ๐Ÿ†• methods are helper functions to allow the use of options/subcommands from one group to trigger another group on or off.
  644 +The `CLI::TriggerOn` and `CLI::TriggerOff` methods are helper functions to allow the use of options/subcommands from one group to trigger another group on or off.
645 645  
646 646 ```cpp
647 647 CLI::TriggerOn(group1_pointer, triggered_group);
... ... @@ -650,7 +650,7 @@ CLI::TriggerOff(group2_pointer, disabled_group);
650 650  
651 651 These functions make use of `preparse_callback`, `enabled_by_default()` and `disabled_by_default`. The triggered group may be a vector of group pointers. These methods should only be used once per group and will override any previous use of the underlying functions. More complex arrangements can be accomplished using similar methodology with a custom `preparse_callback` function that does more.
652 652  
653   -Additional helper functions `deprecate_option` ๐Ÿšง and `retire_option` ๐Ÿšง are available to deprecate or retire options
  653 +Additional helper functions `deprecate_option` ๐Ÿ†• and `retire_option` ๐Ÿ†• are available to deprecate or retire options
654 654 ```cpp
655 655 CLI::deprecate_option(option *, replacement_name="");
656 656 CLI::deprecate_option(App,option_name,replacement_name="");
... ... @@ -679,7 +679,7 @@ app.set_config(option_name=&quot;&quot;,
679 679 required=false)
680 680 ```
681 681  
682   -If this is called with no arguments, it will remove the configuration file option (like `set_help_flag`). Setting a configuration option is special. If it is present, it will be read along with the normal command line arguments. The file will be read if it exists, and does not throw an error unless `required` is `true`. Configuration files are in `ini` format by default, The reader can also accept many files in [TOML] format ๐Ÿšง. (other formats can be added by an adept user, some variations are available through customization points in the default formatter). An example of a file:
  682 +If this is called with no arguments, it will remove the configuration file option (like `set_help_flag`). Setting a configuration option is special. If it is present, it will be read along with the normal command line arguments. The file will be read if it exists, and does not throw an error unless `required` is `true`. Configuration files are in `ini` format by default, The reader can also accept many files in [TOML] format ๐Ÿ†•. (other formats can be added by an adept user, some variations are available through customization points in the default formatter). An example of a file:
683 683  
684 684 ```ini
685 685 ; Comments are supported, using a ;
... ... @@ -695,7 +695,7 @@ str_vector = &quot;one&quot; &quot;two&quot; &quot;and three&quot;
695 695 in_subcommand = Wow
696 696 sub.subcommand = true
697 697 ```
698   - or equivalently in TOML ๐Ÿšง
  698 + or equivalently in TOML ๐Ÿ†•
699 699 ```toml
700 700 # Comments are supported, using a #
701 701 # The default section is [default], case insensitive
... ... @@ -711,7 +711,7 @@ in_subcommand = Wow
711 711 sub.subcommand = true
712 712 ```
713 713  
714   -Spaces before and after the name and argument are ignored. Multiple arguments are separated by spaces. One set of quotes will be removed, preserving spaces (the same way the command line works). Boolean options can be `true`, `on`, `1`, `yes`, ๐Ÿ†• `enable`; or `false`, `off`, `0`, `no`, ๐Ÿ†• `disable` (case insensitive). Sections (and `.` separated names) are treated as subcommands (note: this does not necessarily mean that subcommand was passed, it just sets the "defaults"). You cannot set positional-only arguments. ๐Ÿšง Subcommands can be triggered from config files if the `configurable` flag was set on the subcommand. Then use `[subcommand]` notation will trigger a subcommand and cause it to act as if it were on the command line.
  714 +Spaces before and after the name and argument are ignored. Multiple arguments are separated by spaces. One set of quotes will be removed, preserving spaces (the same way the command line works). Boolean options can be `true`, `on`, `1`, `yes`, `enable`; or `false`, `off`, `0`, `no`, `disable` (case insensitive). Sections (and `.` separated names) are treated as subcommands (note: this does not necessarily mean that subcommand was passed, it just sets the "defaults"). You cannot set positional-only arguments. ๐Ÿ†• Subcommands can be triggered from config files if the `configurable` flag was set on the subcommand. Then use `[subcommand]` notation will trigger a subcommand and cause it to act as if it were on the command line.
715 715  
716 716 To print a configuration file from the passed
717 717 arguments, use `.config_to_str(default_also=false, prefix="", write_description=false)`, where `default_also` will also show any defaulted arguments, `prefix` will add a prefix, and `write_description` will include option descriptions. See [Config files](https://cliutils.github.io/CLI11/book/chapters/config.html) for some additional details.
... ... @@ -720,7 +720,7 @@ arguments, use `.config_to_str(default_also=false, prefix=&quot;&quot;, write_description=
720 720  
721 721 Many of the defaults for subcommands and even options are inherited from their creators. The inherited default values for subcommands are `allow_extras`, `prefix_command`, `ignore_case`, `ignore_underscore`, `fallthrough`, `group`, `footer`,`immediate_callback` and maximum number of required subcommands. The help flag existence, name, and description are inherited, as well.
722 722  
723   -Options have defaults for `group`, `required`, `multi_option_policy`, `ignore_case`, `ignore_underscore`, ๐Ÿ†• `delimiter`, and ๐Ÿ†• `disable_flag_override`. To set these defaults, you should set the `option_defaults()` object, for example:
  723 +Options have defaults for `group`, `required`, `multi_option_policy`, `ignore_case`, `ignore_underscore`, `delimiter`, and `disable_flag_override`. To set these defaults, you should set the `option_defaults()` object, for example:
724 724  
725 725 ```cpp
726 726 app.option_defaults()->required();
... ...
include/CLI/Validators.hpp
1 1 #pragma once
  2 +
2 3 // Distributed under the 3-Clause BSD License. See accompanying
3 4 // file LICENSE or https://github.com/CLIUtils/CLI11 for details.
4 5  
... ...
include/CLI/Version.hpp
... ... @@ -6,8 +6,8 @@
6 6 // [CLI11:verbatim]
7 7  
8 8 #define CLI11_VERSION_MAJOR 1
9   -#define CLI11_VERSION_MINOR 8
  9 +#define CLI11_VERSION_MINOR 9
10 10 #define CLI11_VERSION_PATCH 0
11   -#define CLI11_VERSION "1.8.0"
  11 +#define CLI11_VERSION "1.9.0"
12 12  
13 13 // [CLI11:verbatim]
... ...