mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-101599: argparse: simplify the option help string (GH-103372)
If the option with argument has short and long names, output argument only once, after the long name: -o, --option ARG description instead of -o ARG, --option ARG description
This commit is contained in:
parent
73d20cafb5
commit
c4a2e8a2c5
3 changed files with 7 additions and 10 deletions
|
@ -3922,7 +3922,7 @@ class TestHelpUsageWithParentheses(HelpTestCase):
|
|||
|
||||
options:
|
||||
-h, --help show this help message and exit
|
||||
-p {1 (option A), 2 (option B)}, --optional {1 (option A), 2 (option B)}
|
||||
-p, --optional {1 (option A), 2 (option B)}
|
||||
'''
|
||||
version = ''
|
||||
|
||||
|
@ -4405,8 +4405,8 @@ class TestHelpAlternatePrefixChars(HelpTestCase):
|
|||
help = usage + '''\
|
||||
|
||||
options:
|
||||
^^foo foo help
|
||||
;b BAR, ;;bar BAR bar help
|
||||
^^foo foo help
|
||||
;b, ;;bar BAR bar help
|
||||
'''
|
||||
version = ''
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue