def filter_subcommand_args(func, options):
kwargs = {}<EOL>argspec = inspect.getargspec(func)<EOL>for arg in argspec.args:<EOL><INDENT>if arg in options:<EOL><INDENT>kwargs.update({arg: getattr(options, arg)})<EOL><DEDENT><DEDENT>return kwargs<EOL>
Filter out all options which are not part of the function *func*
prototype and returns a set that can be used as kwargs for calling func.