Option#
- class cli_interview_kit.Option[source]#
Bases:
FrozenModelA plain option or positional argument; not an interview question.
Options choose what a command does (
--check,--dry-run) or name what it acts on. Anything the user could be asked belongs in the interview instead.- Attributes:
- deststr
The name the value is read by, in snake_case; the flag is
--plus the name with dashes.- helpstr
Help text.
- kindLiteral[‘switch’, ‘value’, ‘append’, ‘positional’]
switchis an on/off flag;valuetakes one value;appendis repeatable;positionalis an argument.- metavarstr | None
Value placeholder in help.
- choicestuple[str, …]
Allowed values.
- nargsLiteral[‘?’, ‘*’, ‘+’] | None
A positional’s arity, e.g.
"*".- convertCallable[[str], Any] | None
Converts and checks a value; raising
ValueErroris a usage error.- exclusivestr | None
Options sharing this name are mutually exclusive.
flagstrThe option’s flag, or its name for a positional.
Methods
describe()Describe the option as
--questionslists it.