Skip to content

Commit fa9bb9a

Browse files
[3.14] pythongh-140693: Improve argparse documentation about controlling color (pythonGH-140737) (python#140932)
pythongh-140693: Improve `argparse` documentation about controlling color (pythonGH-140737) (cherry picked from commit 31de83d) Co-authored-by: Krishna Chaitanya <[email protected]>
1 parent cdb6fe8 commit fa9bb9a

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
@@ -639,6 +639,11 @@ by setting ``color`` to ``False``::
639639
... help='an integer for the accumulator')
640640
>>> parser.parse_args(['--help'])
641641

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

644649

0 commit comments

Comments
 (0)