Summary
Add choices parameter to argument and option functions to accept list of allowed values for an argument or an option. Reject any values that do not match the provided list.
Enhancement's value
- This would allow developers to specify a limited set of choices and automatically validate the input against that list.
- It will be rendered in the documentation generated via
--help, help and, thus, automatically explain to user what values are accepted for this option/argument – huge help for users.
Notes
Maybe take the same approach that works in argparse?
Summary
Add
choicesparameter toargumentandoptionfunctions to accept list of allowed values for an argument or an option. Reject any values that do not match the provided list.Enhancement's value
--help,helpand, thus, automatically explain to user what values are accepted for this option/argument – huge help for users.Notes
Maybe take the same approach that works in
argparse?