code: def filter_subcommand_args(func, options):
      
      kwargs = {}
      argspec = inspect.getargspec(func)
      for arg in argspec.args:
          if arg in options:
              kwargs.update({arg: getattr(options, arg)})
      return kwargs
docs: 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.