mirror of https://github.com/python/cpython
gh-77956: Add the words 'default' and 'version' help text localizable (GH-12711)
Co-authored-by: paul.j3 Co-authored-by: Jérémie Detrey <jdetrey@users.noreply.github.com>
This commit is contained in:
parent
37a13b9413
commit
da382aaf52
|
@ -708,7 +708,7 @@ class ArgumentDefaultsHelpFormatter(HelpFormatter):
|
||||||
if action.default is not SUPPRESS:
|
if action.default is not SUPPRESS:
|
||||||
defaulting_nargs = [OPTIONAL, ZERO_OR_MORE]
|
defaulting_nargs = [OPTIONAL, ZERO_OR_MORE]
|
||||||
if action.option_strings or action.nargs in defaulting_nargs:
|
if action.option_strings or action.nargs in defaulting_nargs:
|
||||||
help += ' (default: %(default)s)'
|
help += _(' (default: %(default)s)')
|
||||||
return help
|
return help
|
||||||
|
|
||||||
|
|
||||||
|
@ -1159,8 +1159,10 @@ class _VersionAction(Action):
|
||||||
version=None,
|
version=None,
|
||||||
dest=SUPPRESS,
|
dest=SUPPRESS,
|
||||||
default=SUPPRESS,
|
default=SUPPRESS,
|
||||||
help="show program's version number and exit",
|
help=None,
|
||||||
deprecated=False):
|
deprecated=False):
|
||||||
|
if help is None:
|
||||||
|
help = _("show program's version number and exit")
|
||||||
super(_VersionAction, self).__init__(
|
super(_VersionAction, self).__init__(
|
||||||
option_strings=option_strings,
|
option_strings=option_strings,
|
||||||
dest=dest,
|
dest=dest,
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Add 'default' and 'version' help text for localization in argparse.
|
Loading…
Reference in New Issue