You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use it for the default in `set_config` and simplify and add more
flexibility to the the config processing, and potentially in other
options as well.
The reverse policy returns a vector but in reversed order from normal.
This is what we want in the config processing
Inspired by #862, and updated with recent code changes.
---------
Co-authored-by: Volker Christian <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Copy file name to clipboardExpand all lines: book/chapters/options.md
+23-1Lines changed: 23 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -222,7 +222,7 @@ that to add option modifiers. A full listing of the option modifiers:
222
222
|`->allow_extra_args()`| Allow extra argument values to be included when an option is passed. Enabled by default for vector options. |
223
223
|`->disable_flag_override()`| specify that flag options cannot be overridden on the command line use `=<newval>`|
224
224
|`->delimiter('<CH>')`| specify a character that can be used to separate elements in a command line argument, default is <none>, common values are ',', and ';' |
225
-
|`->multi_option_policy( CLI::MultiOptionPolicy::Throw)`| Sets the policy for handling multiple arguments if the option was received on the command line several times. `Throw`ing an error is the default, but `TakeLast`, `TakeFirst`, `TakeAll`, `Join`, and `Sum` are also available. See the next four lines for shortcuts to set this more easily.|
225
+
|`->multi_option_policy( CLI::MultiOptionPolicy::Throw)`| Sets the policy for handling multiple arguments if the option was received on the command line several times. `Throw`ing an error is the default, but `TakeLast`, `TakeFirst`, `TakeAll`, `Join`, `Reverse`, and `Sum` are also available. See the next four lines for shortcuts to set this more easily. |
226
226
|`->take_last()`| Only use the last option if passed several times. This is always true by default for bool options, regardless of the app default, but can be set to false explicitly with `->multi_option_policy()`. |
0 commit comments