Open mattgodbolt opened 5 years ago
Hey neighbor.. Thanks for the idea. I implemented that in my Lyra fork: https://github.com/bfgroup/Lyra/commit/ccdf09f043bc8af09516e0fbc82be705c298a53e (examples here https://raw.githack.com/bfgroup/Lyra/develop/docs/lyra.html#_option_value_choices).
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!)