enable composing PositionalArgs (#896)

* enable composing PositionalArgs
* ExactValidArgs slated for removal
* tests and docs
* rename to MatchAll
This commit is contained in:
Nelz
2021-12-07 14:38:00 -08:00
committed by GitHub
parent 9e1d6f1c2a
commit 45e521ea93
3 changed files with 62 additions and 0 deletions

View File

@ -315,6 +315,7 @@ The following validators are built in:
- `ExactArgs(int)` - the command will report an error if there are not exactly N positional args.
- `ExactValidArgs(int)` - the command will report an error if there are not exactly N positional args OR if there are any positional args that are not in the `ValidArgs` field of `Command`
- `RangeArgs(min, max)` - the command will report an error if the number of args is not between the minimum and maximum number of expected args.
- `MatchAll(pargs ...PositionalArgs)` - enables combining existing checks with arbitrary other checks (e.g. you want to check the ExactArgs length along with other qualities).
An example of setting the custom validator: