sdispater / clikit

CliKit is a group of utilities to build beautiful and testable command line interfaces.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: Allow a `choices` equivalent for Option

jeffb4 opened this issue · comments

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