Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

"enum" type values #98

Open
mattgodbolt opened this issue Aug 8, 2019 · 1 comment
Open

"enum" type values #98

mattgodbolt opened this issue Aug 8, 2019 · 1 comment

Comments

@mattgodbolt
Copy link

I'd love a way to constrain a positional argument to "one of" a range of values only. For example, one of a selection of strings like "slow", "medium" or "fast" (for a --speed slow type argument). I couldn't see how to do it without just checking the string value afterwards (which is fine, but this seems like a common enough use case!)

@grafikrobot
Copy link

Hey neighbor.. Thanks for the idea. I implemented that in my Lyra fork: bfgroup/Lyra@ccdf09f (examples here https://raw.githack.com/bfgroup/Lyra/develop/docs/lyra.html#_option_value_choices).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants