-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
How to implement something like an OptionFlag? #1154
Comments
To rephrase the question - are if asking if there's a builtin way to implement a flag that gives users a set of choices from a predefined list? Something like |
@lynncyrin yes that is exactly what I meant. |
Makes sense! There's no obvious builtin way to implement this, but I've implemented a few "manual" versions of it. I don't happen to have that code on-hand, though. |
@lynncyrin would be great if you could dig it up and share a snippet here with the community. I'm happy to take that snippet of your further to integrate it here. |
Ping @lynncyrin |
This was previously requested in #620 |
This issue or PR has been automatically marked as stale because it has not had recent activity. Please add a comment bumping this if you're still interested in it's resolution! Thanks for your help, please let us know if you need anything else. |
Not stale |
This issue or PR has been bumped and is no longer marked as stale! Feel free to bump it again in the future, if it's still relevant. |
Here is how I implemented it using GenericFlag and a custom value |
There is a PR for this feature. #1234 |
This issue or PR has been automatically marked as stale because it has not had recent activity. Please add a comment bumping this if you're still interested in it's resolution! Thanks for your help, please let us know if you need anything else. |
Closing this as it has become stale. |
Wy Wy Wy! should we open it again? |
This issue or PR has been bumped and is no longer marked as stale! Feel free to bump it again in the future, if it's still relevant. |
This is a duplicate of #786 . |
How to implement something like an OptionFlag
I'm looking to implement a Flag which can have a few predefined values.
E.g.
Is there a way to implement this using the existing flags while also informing the user of the cli what are the available options?
If not would it make sense to add this OptionFlag? I would be happy to make a PR for that with some guidance.
The text was updated successfully, but these errors were encountered: