Skip to content

Commit 82c7e25

Browse files
committed
Improve description of disabling colour support locally vs in the ArgumentParser
1 parent b5c0d88 commit 82c7e25

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Doc/library/argparse.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -620,8 +620,11 @@ keyword argument::
620620
color
621621
^^^^^
622622

623-
By default, the help message is printed in color. If you want plain text
624-
help messages, you can disable it by setting ``color`` to ``False``::
623+
By default, the help message is printed in color using `ANSI escape sequences
624+
<https://en.wikipedia.org/wiki/ANSI_escape_code>`__.
625+
If you want plain text help messages, you can disable this :ref:`in your local
626+
environment <using-on-controlling-color>`, or in the argument parser itself
627+
by setting ``color`` to ``False``::
625628

626629
>>> parser = argparse.ArgumentParser(description='Process some integers.',
627630
... color=False)
@@ -630,9 +633,6 @@ help messages, you can disable it by setting ``color`` to ``False``::
630633
... help='an integer for the accumulator')
631634
>>> parser.parse_args(['--help'])
632635

633-
Even if a CLI author has not disabled color, it can be
634-
:ref:`controlled using environment variables <using-on-controlling-color>`.
635-
636636
.. versionadded:: 3.14
637637

638638

0 commit comments

Comments
 (0)