argparse does not accept options taking arguments beginning with dash (regression from optparse)
http://bugs.python.org/issue9334
Date: 2013-03-22 10:16
This patch makes two changes to argparse.py ArgumentParser._parse_optional()
- accept negative scientific and complex numbers
- add the args_default_to_positional parser option
argparse handling multiple "--" in args improperly
also 14364 - Argparse incorrectly handles '--'

This patch removes only one '--', the one that put a '-' in the
'arg_strings_pattern'.  It does this in 'consume_positionals' right
before calling 'take_action'.  As before it does not do this if
nargs is PARSER or REMAINDER.

It only removes the '--' that marked the end of options.

13922 is closed, but my patch refines it; it also fixes 14364
Maybe it should be billed as 14364 fix rather than 13922 reopen.
issue9253
argparse: optional subparsers

issue12776 changed how 'required' arguments were tested; subparsers fell
through the crack, and now are optional.

Make subparser action required by default; admit required parameter
Return a useful 'name' for subparser if it has no 'dest' (for error msg).

Correction to doc
Add test
correct 3 'DeprecationWarning: Please use assertRaisesRegex instead.' cases
(correction here, not in patch)
15125 - argparse: positional arguments containing - in name not
handled well
17965 duplicate closed

change positionals 'dest' '-' to '_' (but enable access with '-')
patch downloaded (sfllaw)
correct a 'DeprecationWarning: Please use assertRaisesRegex instead.' warning
(need to submit change to issue)
9338 - argparse optionals with nargs='?', '*' or '+' can't be followed by positionals


testing produces a log
add the nargs range patch to greedy
.rst from range patch
11354 - argparse: nargs could accept range of options count
Accept regex like range '{m,n}', also tuple '(m,n)'.
(a related issue is 'greedyopt' and a port of range to that)
more tests
tweak to re expression
14191 - argparse doesn't allow optionals within positionals
patch to allow free intermix of optionals and positionals (as in optparse)
uses a parse_known_intermixed_args method that first suppresses the
positionals and does a parse, then runs a parse on the positionals.
Revision
adds: action.nargs == SUPPRESS
uses this to 'deactivate' optionals (instead of nargs=0)
Replace the 'fallback' approach with raising a TypeError.

The 'fallback' that I used earlier can be implemented with a simple 'try/except TypeError'.
Merge branch 'issue9253' into composite
Merge branch 'issue15125' into composite
Merge branch 'issue9338' into composite
argparse only supports iterable choices
(issue has prior patch by chris.jerdonek)


incorporates issues 9849 (better add_argument testing) and 9625 (choices with *)
related (but not included): issue11874 which rewrites _format_actions_usage()
Issue 18349
Issue 16977
change in test choices='abc' to choices=['a','b','c']
14074 - argparse allows nargs>1 for positional arguments but doesn't allow metavar to be a tuple
This patch fixes the problem by joining the metavar terms with '|'.
minor change to argparse.py
Merge branch 'issue14074' into composite
15112 - - argparse: nargs='*' positional argument doesn't accept any items if preceded by an option and another positional
don't consume a possibly zero length positional if there still are optionals to proceess
There are several ways of testing this.