Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
vduseev opened this issue Oct 16, 2020 · 0 comments
Open

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

vduseev opened this issue Oct 16, 2020 · 0 comments
Milestone

Comments

@vduseev
Copy link

vduseev commented Oct 16, 2020

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?

@Secrus Secrus added this to the 1.1 milestone Sep 5, 2022
@Secrus Secrus modified the milestones: 2.1 , Future Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants