Commit 0b592bfa by Craig Heffner

Fixed bug in API argument parser where an argument of '1' was treated as 'True'

parent c00c53ae
...@@ -670,7 +670,7 @@ class Modules(object): ...@@ -670,7 +670,7 @@ class Modules(object):
if kargv: if kargv:
for (k, v) in iterator(kargv): for (k, v) in iterator(kargv):
k = self._parse_api_opt(k) k = self._parse_api_opt(k)
if v not in [True, False, None]: if v is not True and v is not False and v is not None:
if not isinstance(v, list): if not isinstance(v, list):
v = [v] v = [v]
for value in v: for value in v:
...@@ -965,8 +965,7 @@ class Modules(object): ...@@ -965,8 +965,7 @@ class Modules(object):
except Exception as e: except Exception as e:
raise ModuleException("Invalid usage: %s" % str(e)) raise ModuleException("Invalid usage: %s" % str(e))
binwalk.core.common.debug("%s :: %s => %s" % binwalk.core.common.debug("%s :: %s => %s" % (module.TITLE, str(argv), str(kwargs)))
(module.TITLE, str(argv), str(kwargs)))
return kwargs return kwargs
def kwargs(self, obj, kwargs): def kwargs(self, obj, kwargs):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment