Commit c4ef1b68 by devttys0

Fixed --dd bug.

parent 464a7d8c
......@@ -721,6 +721,9 @@ class Modules(object):
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):
if not has_key(last_priority, name) or last_priority[name] <= module_option.priority:
......@@ -742,6 +745,8 @@ class Modules(object):
elif module_option.type == list:
if not has_key(kwargs, name):
kwargs[name] = []
# HACK. Fix the above TODO and this check is no longer necessary
if type(kwargs[name]) == list:
kwargs[name].append(value)
else:
kwargs[name] = value
......
......@@ -33,7 +33,7 @@ class Extractor(Module):
description='Automatically extract known file types'),
Option(short='D',
long='dd',
type=[],
type=list,
dtype='type:ext:cmd',
kwargs={'manual_rules' : [], 'enabled' : True},
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