add --color option

This commit is contained in:
Anthony Sottile 2021-11-05 20:05:53 -04:00
parent 05cae7e046
commit 848003cc05
10 changed files with 181 additions and 2 deletions

View file

@ -40,6 +40,8 @@ Index of Options
- :option:`flake8 --quiet`
- :option:`flake8 --color`
- :option:`flake8 --count`
- :option:`flake8 --diff`
@ -181,6 +183,35 @@ Options and their Descriptions
quiet = 1
.. option:: --color
:ref:`Go back to index <top>`
Whether to use color in output. Defaults to ``auto``.
Possible options are ``auto``, ``always``, and ``never``.
This **can** be specified in config files.
When color is enabled, the following substitutions are enabled:
- ``%(bold)s``
- ``%(black)s``
- ``%(red)s``
- ``%(green)s``
- ``%(yellow)s``
- ``%(blue)s``
- ``%(magenta)s``
- ``%(cyan)s``
- ``%(white)s``
- ``%(reset)s``
Example config file usage:
.. code-block:: ini
color = never
.. option:: --count