summaryrefslogtreecommitdiffstats
path: root/Lib/argparse.py
Commit message (Collapse)AuthorAgeFilesLines
* #9351: set_defaults on subparser is no longer ignored if set on parent.R David Murray2014-10-181-1/+8
| | | | | | | | Before, if a default was set on the parent parser, any default for that variable set via set_defaults on a subparser would be ignored. Now the subparser set_defaults is honored. Patch by Jyrki Pullianinen.
* Issue #21481: Teach argparse equality tests to return NotImplemented when ↵Raymond Hettinger2014-05-261-0/+4
| | | | comparing to unknown types.
* Issue #13107: argparse and optparse no longer raises an exception when outputSerhiy Storchaka2014-01-091-3/+5
| | | | | a help on environment with too small COLUMNS. Based on patch by Elazar Gershuni.
* A follow up for issue #15906: change the test for calling the type conversionBarry Warsaw2012-09-121-1/+1
| | | | | | | | on the action's default, reverting it back to previous behavior. Conversion is only done on string defaults. Add a test for this and another test that ensures such type conversions are only called once.
* - Issue #15906: Fix a regression in argparse caused by the preceding change,Barry Warsaw2012-09-121-0/+1
| | | | when action='append', type='str' and default=[].
* #15847: allow args to be a tuple in parse_argsR David Murray2012-09-081-1/+4
| | | | | | | | This fixes a regression introduced by the fix for issue #13922. Although args is not documented as being allowed to be a tuple, previously this worked and so naturally there are programs in the field that depend on it. Patch by Zbyszek Jędrzejewski-Szmek.
* #12776,#11839: call argparse type function only once.R David Murray2012-09-011-7/+14
| | | | | | | | | Before, the type function was called twice in the case where the default was specified and the argument was given as well. This was especially problematic for the FileType type, as a default file would always be opened, even if a file argument was specified on the command line. Patch by Arnaud Fontaine, with additional test by Mike Meyer.
* #13922: argparse no longer incorrectly strips '--' after the first one.R David Murray2012-07-221-2/+5
| | | | Patch by Jeff Knupp.
* #12353: argparse now correctly handles null argument values.R David Murray2012-07-221-1/+1
| | | | Patch by Torsten Landschoff.
* #14391: clarify docstring discussion of Action's 'type' argument's value.R David Murray2012-07-211-4/+4
|
* Issue #9347: Fix formatting for tuples in argparse type= error messages.Steven Bethard2011-04-031-2/+2
|
* Issue #9026: Fix order of argparse sub-commands in help messages. (Merged ↵Steven Bethard2011-03-271-1/+2
| | | | from 3.2.)
* Issue #9348: Raise an early error if argparse nargs and metavar don't match. ↵Steven Bethard2011-03-261-0/+7
| | | | (Merge from 3.2.)
* #10680: fix mutually exclusive arguments in argument groups.Steven Bethard2011-01-301-0/+1
|
* Issue #9509: make argarse properly handle IOErrors raised by ↵Steven Bethard2011-01-241-6/+7
| | | | argparse.FileType. Approved by Georg in the tracker.
* Merged revisions 86985 via svnmerge fromÉric Araujo2010-12-031-2/+2
| | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86985 | eric.araujo | 2010-12-03 20:19:17 +0100 (ven., 03 déc. 2010) | 5 lines Fix incorrect use of gettext in argparse (#10497). Steven, the maintainer of argparse, agreed to have this committed without tests for now, since the fix is obvious. See the bug log. ........
* Merged revisions 86111 via svnmerge fromSteven Bethard2010-11-021-2/+12
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86111 | steven.bethard | 2010-11-02 13:47:22 +0100 (Tue, 02 Nov 2010) | 1 line Fix bug 9340 - argparse parse_known_args didn't work with subparsers ........
* Merged revisions 86092 via svnmerge fromSteven Bethard2010-11-011-2/+8
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86092 | steven.bethard | 2010-11-01 17:29:26 +0100 (Mon, 01 Nov 2010) | 1 line Fix for issue 9355 where with multiple mutually exclusive arguments, some brackets were being lost in the usage messages ........
* Merged revisions 86090 via svnmerge fromSteven Bethard2010-11-011-7/+7
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86090 | steven.bethard | 2010-11-01 16:57:36 +0100 (Mon, 01 Nov 2010) | 1 line Fix bug 9352 where characters were being lost in parsing some short options ........
* Merged revisions 86086 via svnmerge fromSteven Bethard2010-11-011-3/+10
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86086 | steven.bethard | 2010-11-01 16:23:12 +0100 (Mon, 01 Nov 2010) | 1 line Get argparse.__all__ back up to date (issue 9353) ........
* Merged revisions 83675 via svnmerge fromR. David Murray2010-08-031-2/+5
| | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83675 | r.david.murray | 2010-08-03 13:56:09 -0400 (Tue, 03 Aug 2010) | 12 lines #9444: use first of prefix_chars for help opt instead of raising error An argparse option parser created with a prefix_chars that did not include a '-' would happily add -h and --help options, and then throw an error when it tried to format the help because the - was an invalid prefix character. This patch makes it use the first character of prefix_chars as the character for the help options if and only if '-' is not one of the valid prefix_chars. Fix by Theodore Turocy, unit tests by Catherine Devlin. ........
* Fix default value for version help. Approved by Benjamin on python-dev: ↵Steven Bethard2010-05-241-1/+1
| | | | http://mail.python.org/pipermail/python-dev/2010-May/100231.html
* replace copy right notice with simple attributionBenjamin Peterson2010-03-241-13/+1
|
* eliminate py3k warnings in argparseBenjamin Peterson2010-03-071-0/+2
|
* remove cross-version compatibility codeBenjamin Peterson2010-03-021-28/+7
|
* remove code to avoid BaseException.message bugBenjamin Peterson2010-03-021-9/+0
|
* set svn:eol-styleBenjamin Peterson2010-03-021-2351/+2351
|
* remove coding cookie as mandated by PEP 8Benjamin Peterson2010-03-021-3/+1
|
* Initial commit of the argparse library, based on argparse 1.1.Steven Bethard2010-03-021-0/+2353
Docs still need some updating to make getopt and optparse match the wording promised in the PEP. There are also probably a number of :class:ArgumentParser etc. links that could be added to the argparse documentation.