Skip to content

Commit 5415561

Browse files
committed
Add colors to interpolated values in argparse
1 parent da1d468 commit 5415561

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Lib/argparse.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,11 @@ def _expand_help(self, action):
674674
params[name] = value.__name__
675675
if params.get('choices') is not None:
676676
params['choices'] = ', '.join(map(str, params['choices']))
677+
# Adding colors to params values
678+
t = self._theme
679+
for name in params:
680+
value = params[name]
681+
params[name] = f"{t.default_value}{value}{t.reset}"
677682
return help_string % params
678683

679684
def _iter_indented_subactions(self, action):

0 commit comments

Comments
 (0)