mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #3850 from segevfiner/make-mode-help-colors
Fix color handling in make mode's help command
This commit is contained in:
commit
ed97a838ee
@ -22,7 +22,7 @@ from os import path
|
|||||||
|
|
||||||
import sphinx
|
import sphinx
|
||||||
from sphinx import cmdline
|
from sphinx import cmdline
|
||||||
from sphinx.util.console import bold, blue # type: ignore
|
from sphinx.util.console import color_terminal, nocolor, bold, blue # type: ignore
|
||||||
from sphinx.util.osutil import cd, rmtree
|
from sphinx.util.osutil import cd, rmtree
|
||||||
|
|
||||||
if False:
|
if False:
|
||||||
@ -87,6 +87,9 @@ class Make(object):
|
|||||||
|
|
||||||
def build_help(self):
|
def build_help(self):
|
||||||
# type: () -> None
|
# type: () -> None
|
||||||
|
if not color_terminal():
|
||||||
|
nocolor()
|
||||||
|
|
||||||
print(bold("Sphinx v%s" % sphinx.__display_version__))
|
print(bold("Sphinx v%s" % sphinx.__display_version__))
|
||||||
print("Please use `make %s' where %s is one of" % ((blue('target'),) * 2)) # type: ignore # NOQA
|
print("Please use `make %s' where %s is one of" % ((blue('target'),) * 2)) # type: ignore # NOQA
|
||||||
for osname, bname, description in BUILDERS:
|
for osname, bname, description in BUILDERS:
|
||||||
|
Loading…
Reference in New Issue
Block a user