cleo icon indicating copy to clipboard operation
cleo copied to clipboard

Add "choices" parameter to argument and option as in argparse

Open vduseev opened this issue 5 years ago • 0 comments

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?

vduseev avatar Oct 16 '20 23:10 vduseev