Skip to content

Commit 31de83d

Browse files
authored
gh-140693: Improve argparse documentation about controlling color (#140737)
1 parent 9e5628a commit 31de83d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Doc/library/argparse.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,11 @@ by setting ``color`` to ``False``::
638638
... help='an integer for the accumulator')
639639
>>> parser.parse_args(['--help'])
640640

641+
Note that when ``color=True``, colored output depends on both environment
642+
variables and terminal capabilities. However, if ``color=False``, colored
643+
output is always disabled, even if environment variables like ``FORCE_COLOR``
644+
are set.
645+
641646
.. versionadded:: 3.14
642647

643648

0 commit comments

Comments
 (0)