mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 17:46:37 +03:00
Minor bug fix
This commit is contained in:
parent
871ebfdb70
commit
f05f84b6e5
|
@ -18,7 +18,7 @@ from lib.core.enums import OS
|
||||||
from thirdparty.six import unichr as _unichr
|
from thirdparty.six import unichr as _unichr
|
||||||
|
|
||||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||||
VERSION = "1.3.9.22"
|
VERSION = "1.3.9.23"
|
||||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
||||||
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||||
|
|
|
@ -44,6 +44,26 @@ finally:
|
||||||
def get_groups(parser):
|
def get_groups(parser):
|
||||||
return getattr(parser, "option_groups", None) or getattr(parser, "_action_groups")
|
return getattr(parser, "option_groups", None) or getattr(parser, "_action_groups")
|
||||||
|
|
||||||
|
def get_all_options(parser):
|
||||||
|
retVal = set()
|
||||||
|
|
||||||
|
for option in get_actions(parser):
|
||||||
|
if hasattr(option, "option_strings"):
|
||||||
|
retVal.update(option.option_strings)
|
||||||
|
else:
|
||||||
|
retVal.update(option._long_opts)
|
||||||
|
retVal.update(option._short_opts)
|
||||||
|
|
||||||
|
for group in get_groups(parser):
|
||||||
|
for option in get_actions(group):
|
||||||
|
if hasattr(option, "option_strings"):
|
||||||
|
retVal.update(option.option_strings)
|
||||||
|
else:
|
||||||
|
retVal.update(option._long_opts)
|
||||||
|
retVal.update(option._short_opts)
|
||||||
|
|
||||||
|
return retVal
|
||||||
|
|
||||||
from lib.core.common import checkOldOptions
|
from lib.core.common import checkOldOptions
|
||||||
from lib.core.common import checkSystemEncoding
|
from lib.core.common import checkSystemEncoding
|
||||||
from lib.core.common import dataToStdout
|
from lib.core.common import dataToStdout
|
||||||
|
@ -844,18 +864,10 @@ def cmdLineParser(argv=None):
|
||||||
parser.usage = ""
|
parser.usage = ""
|
||||||
cmdLineOptions.sqlmapShell = True
|
cmdLineOptions.sqlmapShell = True
|
||||||
|
|
||||||
_ = ["x", "q", "exit", "quit", "clear"]
|
commands = set(("x", "q", "exit", "quit", "clear"))
|
||||||
|
commands.update(get_all_options(parser))
|
||||||
|
|
||||||
for option in get_actions(parser):
|
autoCompletion(AUTOCOMPLETE_TYPE.SQLMAP, commands=commands)
|
||||||
_.extend(option._long_opts)
|
|
||||||
_.extend(option._short_opts)
|
|
||||||
|
|
||||||
for group in get_groups(parser):
|
|
||||||
for option in get_actions(group):
|
|
||||||
_.extend(option._long_opts)
|
|
||||||
_.extend(option._short_opts)
|
|
||||||
|
|
||||||
autoCompletion(AUTOCOMPLETE_TYPE.SQLMAP, commands=_)
|
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
command = None
|
command = None
|
||||||
|
|
Loading…
Reference in New Issue
Block a user