paul j3 added the comment:
This patch modifies that '--' handling from 13922, removing '--' from PARSER
and REMAINDER if it is the first string:
if action.nargs not in [PARSER, REMAINDER]:
try:
arg_strings.remove('--')
except ValueError:
paul j3 added the comment:
In elsdoerfer's example, the '--' effectively ends the argument list for
'--ignore'. '--' are not allowed in the arguments of an optional (see the end
of '_get_nargs_pattern()').
Rather the problem is at the start of _get_values()
if action.nargs not in
Changes by Mark Lawrence breamore...@yahoo.co.uk:
--
nosy: +paul.j3
versions: +Python 3.5 -Python 3.2
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9571
___
Changes by Éric Araujo mer...@netwok.org:
--
nosy: +eric.araujo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9571
___
___
Python-bugs-list
Steven Bethard steven.beth...@gmail.com added the comment:
This is closely related to issue 9338. The parser should know that your command
line requires at least the COMMAND argument, so it should stop parsing in time
for that. However, in the case of subcommands, even if we solved issue 9338,
New submission from Michael.Elsdörfer mich...@elsdoerfer.info:
argparse already seems to support -- to indicate that what follows are
positional arguments. However, I would like to parse something like:
./script.py --ignore one two -- COMMAND
I.e., --ignore is an nargs='+' argument, and I
R. David Murray rdmur...@bitdance.com added the comment:
It looks like, if accepted, this would be a feature request,so I'm marking it
as such and setting versions to 3.2. You'd have to provide a patch pretty soon
to get it in to 3.2, though.
However, I'm guessing that this is something