Commit c4ef1b68 by devttys0

Fixed --dd bug.

parent 464a7d8c
...@@ -721,6 +721,9 @@ class Modules(object): ...@@ -721,6 +721,9 @@ class Modules(object):
elif has_key(args, module_option.long) and args[module_option.long] not in [None, False]: elif has_key(args, module_option.long) and args[module_option.long] not in [None, False]:
# TODO: There is one module_option.type for many module_option.kwargs. This means that
# all kwargs must be of the same type, else errors can happen in the below processing.
# Fix to check the defined type of each kwarg, and make the module_option.type obsolete.
for (name, value) in iterator(module_option.kwargs): for (name, value) in iterator(module_option.kwargs):
if not has_key(last_priority, name) or last_priority[name] <= module_option.priority: if not has_key(last_priority, name) or last_priority[name] <= module_option.priority:
...@@ -742,7 +745,9 @@ class Modules(object): ...@@ -742,7 +745,9 @@ class Modules(object):
elif module_option.type == list: elif module_option.type == list:
if not has_key(kwargs, name): if not has_key(kwargs, name):
kwargs[name] = [] kwargs[name] = []
kwargs[name].append(value) # HACK. Fix the above TODO and this check is no longer necessary
if type(kwargs[name]) == list:
kwargs[name].append(value)
else: else:
kwargs[name] = value kwargs[name] = value
except KeyboardInterrupt as e: except KeyboardInterrupt as e:
......
...@@ -33,7 +33,7 @@ class Extractor(Module): ...@@ -33,7 +33,7 @@ class Extractor(Module):
description='Automatically extract known file types'), description='Automatically extract known file types'),
Option(short='D', Option(short='D',
long='dd', long='dd',
type=[], type=list,
dtype='type:ext:cmd', dtype='type:ext:cmd',
kwargs={'manual_rules' : [], 'enabled' : True}, kwargs={'manual_rules' : [], 'enabled' : True},
description='Extract <type> signatures, give the files an extension of <ext>, and execute <cmd>'), description='Extract <type> signatures, give the files an extension of <ext>, and execute <cmd>'),
......
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