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:
Pablo Galindo Salgado 2025-07-20 23:55:44 +02:00 committed by GitHub
parent 65d2c51c10
commit acbe896cb1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 39 additions and 25 deletions

View file

@ -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,