Open Veratil opened 7 years ago
This is a good idea. Python's argparse accepts any value that has in
operator as choices
parameter, but in Lua it makes sense to support only arrays, at first at least. I'll try to implement this when I have time, in the meantime pull requests are welcome.
FWIW, this is implemented in the luarocks
branch of this repository, at https://github.com/luarocks/argparse, in https://github.com/luarocks/argparse/pull/3/commits/dcd5162710fcc7f354ffa5eaed574e0cd6f03d06 in particular.
I don't see any mention of this in the docs, but it would be nice to mimic the choices parameter as seen in the python argparse module (https://docs.python.org/dev/library/argparse.html#choices).