Christoph Anton Mitterer <[email protected]> added the comment:
Next to code readability, there's IMO one could reason to properly support this
would be a clean and easy way to get proper help strings for such options.
Of course I can do something like:
parser = argparse.ArgumentParser()
parser.add_argument("--foo", nargs="+", help="Mae govannen", metavar=("bar",
"baz"))
args = parser.parse_args()
and later check that, say, only 2 arguments are allowed.
But the help text will be an ugly:
>$ python3 f.py --help
>usage: f.py [-h] [--foo bar [baz ...]]
>
>optional arguments:
> -h, --help show this help message and exit
> --foo bar [baz ...] Mae govannen
indicating that >1 options were allowed.
----------
nosy: +calestyo
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue11354>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com