[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 [PA

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

2014-07-05 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: +paul.j3 versions: +Python 3.5 -Python 3.2 ___ Python tracker ___ ___ Python-bugs-list mailing list

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

2010-09-20 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

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

2010-08-12 Thread Steven Bethard
Steven Bethard 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, you would still get the

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

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

[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 : 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 need a way to break out of