ArgMacros.jl
ArgMacros.jl copied to clipboard
Specify multiple arguments (i.e. nargs option)
It is fairly typical for some program options to accept multiple arguments, e.g. --imgsize 2000 3000
, or for some options to accept an unknown number of arguments, such as positional arguments, e.g. filename1 [filename2...]
Python's parseargs handles this with an nargs parameter, which can either be an Integer, a '+' (meaning at least one but possibly more), '?' (meaning one or the default), '*' (any number of arguments, including none). See: https://docs.python.org/3/library/argparse.html#nargs
ArgMacros only has a much more limited version of this in 'positionalleftover', which is awkward as it requires manually gathering additional positional arguments and doesn't work for any other options.
Thanks for sharing your concerns and desired features! This will be coming up; my time is pretty tight right now but I’m planning to get multiple-value arguments into ArgMacros in the next couple of weeks.