cleo
cleo copied to clipboard
Add "choices" parameter to argument and option as in argparse
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,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?