I am using scopt to parse command line arguments in scala. I want it to be able to parse options with more than one value. For instance, the range option, if specified, should take exactly two values.
--range 25 45
parser.add_argument("--range", default=None, nargs=2, type=float,
help=(" Foo bar start and stop "))
Looking at the source code, this is not possible. The
Read type class used has a member
tuplesToRead, but it doesn't seem to be working when you force it to
2 instead of
1. You will have to make a feature request, I guess, or work around this by using
--min 25 --max 45, or
--range '25 45' with a custom
Read instance that splits this string into two parts. As @roterl noted, this is not a standard way of parsing.