[issue9338] argparse optionals with nargs='?', '*' or '+' can't be followed by positionals

Steven Bethard report at bugs.python.org
Mon Jul 23 18:57:36 CEST 2012


Steven Bethard <steven.bethard at gmail.com> added the comment:

So Kotan's patch doesn't actually solve the original problem. Instead, it inserts the workaround into the help message of the parser. I think this is probably not the right fix. We should probably do two things:

(1) Right now: create a documentation patch which at least explains the current limitations of argparse parsing, and describes the '--' workaround. Probably this patch should add a separate section about '--', give an example like the one in this issue, and then cross-reference this section from nargs='?', nargs='*', nargs='+' and the "Arguments containing -" section.

(2) Longer term: create a code patch that implements the changes to the regular expression-based parsing like I've suggested.

----------
title: argparse optionals with nargs='+' can't be followed by positionals -> argparse optionals with nargs='?', '*' or '+' can't be followed by positionals

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9338>
_______________________________________


More information about the Python-bugs-list mailing list