mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
bpo-29553: Fix ArgumentParser.format_usage() for mutually exclusive groups (GH-14976)
Co-authored-by: Andrew Nester <andrew.nester.dev@gmail.com>
This commit is contained in:
parent
5dbe0f59b7
commit
da27d9b9dc
3 changed files with 50 additions and 2 deletions
|
@ -404,13 +404,19 @@ class HelpFormatter(object):
|
|||
inserts[start] += ' ['
|
||||
else:
|
||||
inserts[start] = '['
|
||||
inserts[end] = ']'
|
||||
if end in inserts:
|
||||
inserts[end] += ']'
|
||||
else:
|
||||
inserts[end] = ']'
|
||||
else:
|
||||
if start in inserts:
|
||||
inserts[start] += ' ('
|
||||
else:
|
||||
inserts[start] = '('
|
||||
inserts[end] = ')'
|
||||
if end in inserts:
|
||||
inserts[end] += ')'
|
||||
else:
|
||||
inserts[end] = ')'
|
||||
for i in range(start + 1, end):
|
||||
inserts[i] = '|'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue