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
- Extended the `argument` class with a `bool _greedy` member (`false` by default)
- Added a `greedy(bool)` setter method to the `argument` class.
- Aligned the parsing logic to assign all values to a greedy argument (after it's encountered) until its upper `nargs` range is reached
> - If the argument's value type is `ap::none_type`, the argument will not accept any values and therefore no value-related parameters can be set for such argument. This includes:
Notice that even though the `-v` and `--type` command-line arguments have flag prefixes and are not defined in the program, they are not treated as unknown arguments (and therefore no exception is thrown) because the `--args` argument is marked as `greedy` and it consumes these command-line arguments as its values.
472
+
473
+
<br />
474
+
475
+
#### 7. `choices` - A list of valid argument values.
#### 7. Value actions - Function performed after parsing an argument's value.
492
+
#### 8. value actions - Functions that are called after parsing an argument's value.
437
493
Actions are represented as functions, which take the argument's value as an argument. The available action types are:
438
494
439
495
-`observe` actions | `void(const value_type&)` - applied to the parsed value. No value is returned - this action type is used to perform some logic on the parsed value without modifying it.
@@ -478,7 +534,7 @@ Actions are represented as functions, which take the argument's value as an argu
478
534
479
535
<br />
480
536
481
-
#### 8. `default_values` - A list of values which will be used if no values for an argument have been parsed
537
+
#### 9. `default_values` - A list of values which will be used if no values for an argument have been parsed
482
538
483
539
> [!WARNING]
484
540
>
@@ -541,7 +597,7 @@ Command Result
541
597
542
598
Apart from the common parameters listed above, for optional arguments you can also specify the following parameters:
543
599
544
-
#### 1. On-flag actions - For optional arguments, apart from value actions, you can specify on-flag actions which are executed immediately after parsing an argument's flag.
600
+
#### 1. on-flag actions - Functions that are called immediately after parsing an argument's flag.
0 commit comments