mirror of
https://github.com/python/cpython.git
synced 2025-12-08 02:08:20 +00:00
GH-130645: Default to color help in argparse (#136809)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl> Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
This commit is contained in:
parent
65d2c51c10
commit
acbe896cb1
6 changed files with 39 additions and 25 deletions
|
|
@ -167,7 +167,7 @@ class HelpFormatter(object):
|
|||
indent_increment=2,
|
||||
max_help_position=24,
|
||||
width=None,
|
||||
color=False,
|
||||
color=True,
|
||||
):
|
||||
# default setting for width
|
||||
if width is None:
|
||||
|
|
@ -1231,7 +1231,7 @@ class _SubParsersAction(Action):
|
|||
self._name_parser_map = {}
|
||||
self._choices_actions = []
|
||||
self._deprecated = set()
|
||||
self._color = False
|
||||
self._color = True
|
||||
|
||||
super(_SubParsersAction, self).__init__(
|
||||
option_strings=option_strings,
|
||||
|
|
@ -1878,7 +1878,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
|
|||
exit_on_error=True,
|
||||
*,
|
||||
suggest_on_error=False,
|
||||
color=False,
|
||||
color=True,
|
||||
):
|
||||
superinit = super(ArgumentParser, self).__init__
|
||||
superinit(description=description,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue