[issue9571] argparse: Allow the use of -- to break out of nargs and into subparser

2014-07-07 Thread paul j3
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:

[issue9571] argparse: Allow the use of -- to break out of nargs and into subparser

2014-07-06 Thread paul j3
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

[issue9571] argparse: Allow the use of -- to break out of nargs and into subparser

2014-07-05 Thread Mark Lawrence
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 ___

[issue9571] argparse: Allow the use of -- to break out of nargs and into subparser

2010-09-20 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9571 ___ ___ Python-bugs-list

[issue9571] argparse: Allow the use of -- to break out of nargs and into subparser

2010-08-12 Thread Steven Bethard
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,

[issue9571] argparse: Allow the use of -- to break out of nargs and into subparser

2010-08-11 Thread Michael . Elsdörfer
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

[issue9571] argparse: Allow the use of -- to break out of nargs and into subparser

2010-08-11 Thread R. David Murray
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