mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
Fix default value for version help. Approved by Benjamin on python-dev: http://mail.python.org/pipermail/python-dev/2010-May/100231.html
This commit is contained in:
parent
74bd9cf7d0
commit
dce6e1bd5a
2 changed files with 20 additions and 1 deletions
|
@ -987,7 +987,7 @@ class _VersionAction(Action):
|
|||
version=None,
|
||||
dest=SUPPRESS,
|
||||
default=SUPPRESS,
|
||||
help=None):
|
||||
help="show program's version number and exit"):
|
||||
super(_VersionAction, self).__init__(
|
||||
option_strings=option_strings,
|
||||
dest=dest,
|
||||
|
|
|
@ -3699,6 +3699,25 @@ class TestHelpArgumentDefaults(HelpTestCase):
|
|||
'''
|
||||
version = ''
|
||||
|
||||
class TestHelpVersionAction(HelpTestCase):
|
||||
"""Test the default help for the version action"""
|
||||
|
||||
parser_signature = Sig(prog='PROG', description='description')
|
||||
argument_signatures = [Sig('-V', '--version', action='version', version='3.6')]
|
||||
argument_group_signatures = []
|
||||
usage = '''\
|
||||
usage: PROG [-h] [-V]
|
||||
'''
|
||||
help = usage + '''\
|
||||
|
||||
description
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
-V, --version show program's version number and exit
|
||||
'''
|
||||
version = ''
|
||||
|
||||
# =====================================
|
||||
# Optional/Positional constructor tests
|
||||
# =====================================
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue