mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-05-14 01:16:59 +00:00
Merge 1c3a1199b0 into 1a6a5b1226
This commit is contained in:
commit
6b5d2b171c
3 changed files with 9 additions and 1 deletions
|
|
@ -1401,7 +1401,7 @@ def banner():
|
|||
if not any(_ in sys.argv for _ in ("--version", "--api")) and not conf.get("disableBanner"):
|
||||
result = BANNER
|
||||
|
||||
if not IS_TTY or any(_ in sys.argv for _ in ("--disable-coloring", "--disable-colouring")):
|
||||
if not IS_TTY or conf.get("disableColoring") or any(_ in sys.argv for _ in ("--disable-coloring", "--disable-colouring")):
|
||||
result = clearColors(result)
|
||||
elif IS_WIN:
|
||||
coloramainit()
|
||||
|
|
|
|||
|
|
@ -23,6 +23,9 @@ try:
|
|||
|
||||
class _ColorizingStreamHandler(ColorizingStreamHandler):
|
||||
def colorize(self, message, levelno, force=False):
|
||||
from lib.core.data import conf # import inside function to avoid ImportError
|
||||
if conf.get("disableColoring"):
|
||||
return message
|
||||
if levelno in self.level_map and (self.is_tty or force):
|
||||
bg, fg, bold = self.level_map[levelno]
|
||||
params = []
|
||||
|
|
|
|||
|
|
@ -148,6 +148,11 @@ def main():
|
|||
resolveCrossReferences()
|
||||
checkEnvironment()
|
||||
setPaths(modulePath())
|
||||
|
||||
# Check for NO_COLOR environment variable
|
||||
if os.environ.get("NO_COLOR") not in (None, ""):
|
||||
conf.disableColoring = True
|
||||
|
||||
banner()
|
||||
|
||||
# Store original command line options for possible later restoration
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue