sdispater / clikit

CliKit is a group of utilities to build beautiful and testable command line interfaces.
MIT License
72 stars 17 forks source link

Feature request: Allow a `choices` equivalent for Option #6

Open jeffb4 opened 4 years ago

jeffb4 commented 4 years ago

argparse has the concept of setting a choices container for an argument. This is useful for automatically limiting user input and printing allowed choices in generated help, see https://docs.python.org/3/library/argparse.html#choices

I don't know if https://github.com/sdispater/clikit/blob/master/src/clikit/api/args/format/option.py would be the correct place to add such an configuration knob, or what that would look like in the class proper and in the help generation code