Skip to content

Commit f05f84b

Browse files
committed
Minor bug fix
1 parent 871ebfd commit f05f84b

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.3.9.22"
21+
VERSION = "1.3.9.23"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

lib/parse/cmdline.py

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,26 @@ def get_actions(instance):
4444
def get_groups(parser):
4545
return getattr(parser, "option_groups", None) or getattr(parser, "_action_groups")
4646

47+
def get_all_options(parser):
48+
retVal = set()
49+
50+
for option in get_actions(parser):
51+
if hasattr(option, "option_strings"):
52+
retVal.update(option.option_strings)
53+
else:
54+
retVal.update(option._long_opts)
55+
retVal.update(option._short_opts)
56+
57+
for group in get_groups(parser):
58+
for option in get_actions(group):
59+
if hasattr(option, "option_strings"):
60+
retVal.update(option.option_strings)
61+
else:
62+
retVal.update(option._long_opts)
63+
retVal.update(option._short_opts)
64+
65+
return retVal
66+
4767
from lib.core.common import checkOldOptions
4868
from lib.core.common import checkSystemEncoding
4969
from lib.core.common import dataToStdout
@@ -844,18 +864,10 @@ def _format_action_invocation(self, action):
844864
parser.usage = ""
845865
cmdLineOptions.sqlmapShell = True
846866

847-
_ = ["x", "q", "exit", "quit", "clear"]
848-
849-
for option in get_actions(parser):
850-
_.extend(option._long_opts)
851-
_.extend(option._short_opts)
852-
853-
for group in get_groups(parser):
854-
for option in get_actions(group):
855-
_.extend(option._long_opts)
856-
_.extend(option._short_opts)
867+
commands = set(("x", "q", "exit", "quit", "clear"))
868+
commands.update(get_all_options(parser))
857869

858-
autoCompletion(AUTOCOMPLETE_TYPE.SQLMAP, commands=_)
870+
autoCompletion(AUTOCOMPLETE_TYPE.SQLMAP, commands=commands)
859871

860872
while True:
861873
command = None

0 commit comments

Comments
 (0)