-
Couldn't load subscription status.
- Fork 11
Open
Description
choices() function gives programmer an ability to set list of valid values for this option. This is neat because it moves burden of validating input from the programmer to the library.
In my opinion there are currently 2 problems with this:
- argumentum doesn't expose choices to the user. If programmer wants to let user know which choices are available they'd have to manually append them to the
help(). This is flexible yes, but doesn't scale and leaves room for error. - If user provides value outside of the given choices they get rather useless error message (
Error: The value is not in the list of valid values: '--language') that also doesn't specify acceptable values.
It would be great if library could expose these choices automagically. To keep compatibility with existing code we can add additional parameter to choices() function that accepts bool (personally I'd prefer enum) that controls this behaviour with default value to indicate 'off'.
Metadata
Metadata
Assignees
Labels
No labels