mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 01:26:42 +03:00
Implementation of an Issue #149
This commit is contained in:
parent
f358ab2e73
commit
1af81c0de4
|
@ -77,6 +77,7 @@ from lib.core.exception import sqlmapSyntaxException
|
|||
from lib.core.exception import sqlmapUnsupportedDBMSException
|
||||
from lib.core.exception import sqlmapUserQuitException
|
||||
from lib.core.log import FORMATTER
|
||||
from lib.core.log import LOGGER_HANDLER
|
||||
from lib.core.optiondict import optDict
|
||||
from lib.core.purge import purge
|
||||
from lib.core.settings import CODECS_LIST_PAGE
|
||||
|
@ -1995,7 +1996,11 @@ def init(inputOptions=AttribDict(), overrideOptions=False):
|
|||
based upon command line and configuration file options.
|
||||
"""
|
||||
|
||||
coloramainit()
|
||||
if not inputOptions.disableColoring:
|
||||
coloramainit()
|
||||
else:
|
||||
if hasattr(LOGGER_HANDLER, "disable_coloring"):
|
||||
LOGGER_HANDLER.disable_coloring = True
|
||||
__setConfAttributes()
|
||||
__setKnowledgeBaseAttributes()
|
||||
__mergeOptions(inputOptions, overrideOptions)
|
||||
|
|
|
@ -192,6 +192,7 @@ optDict = {
|
|||
"checkPayload": "boolean",
|
||||
"cleanup": "boolean",
|
||||
"dependencies": "boolean",
|
||||
"disableColoring": "boolean",
|
||||
"googlePage": "integer",
|
||||
"mobile": "boolean",
|
||||
"pageRank": "boolean",
|
||||
|
|
|
@ -619,6 +619,10 @@ def cmdLineParser():
|
|||
action="store_true",
|
||||
help="Check for missing sqlmap dependencies")
|
||||
|
||||
miscellaneous.add_option("--disable-coloring", dest="disableColoring",
|
||||
action="store_true",
|
||||
help="Disable console output coloring")
|
||||
|
||||
miscellaneous.add_option("--gpage", dest="googlePage", type="int",
|
||||
help="Use Google dork results from specified page number")
|
||||
|
||||
|
|
|
@ -660,6 +660,10 @@ cleanup = False
|
|||
# Valid: True or False
|
||||
dependencies = False
|
||||
|
||||
# Disable console output coloring.
|
||||
# Valid: True or False
|
||||
disableColoring = False
|
||||
|
||||
# Use Google dork results from specified page number.
|
||||
# Valid: integer
|
||||
# Default: 1
|
||||
|
|
3
thirdparty/ansistrm/ansistrm.py
vendored
3
thirdparty/ansistrm/ansistrm.py
vendored
|
@ -39,11 +39,12 @@ class ColorizingStreamHandler(logging.StreamHandler):
|
|||
}
|
||||
csi = '\x1b['
|
||||
reset = '\x1b[0m'
|
||||
disable_coloring = False
|
||||
|
||||
@property
|
||||
def is_tty(self):
|
||||
isatty = getattr(self.stream, 'isatty', None)
|
||||
return isatty and isatty()
|
||||
return isatty and isatty() and not self.disable_coloring
|
||||
|
||||
def emit(self, record):
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue
Block a user