dissect.target icon indicating copy to clipboard operation
dissect.target copied to clipboard

target-query arguments are not passed to namespace plugin invocations

Open JSCU-CNI opened this issue 8 months ago • 1 comments

The generate_argparse_for_plugin_class function does not parse __args__ of it's exported functions. It probably should, just like generate_argparse_for_unbound_method. Perhaps it should be possible to register plugin-wide arguments in a NamespacePlugin, or the arguments should be derived at runtime when parsing the plugin class.

To reproduce, add an @arg() decorator to for example the FirefoxPlugin.history function and see the difference between target-query -f firefox.history --argument and target-query -f firefox --argument. I would expect both invocations to work.

JSCU-CNI avatar Apr 01 '25 17:04 JSCU-CNI

Note for implementation details: you'll need to separate the arguments into those that the namespace function actually accepts. E.g. not every function in the namespace will accept a random --argument or argument=blah kwarg.

Schamper avatar Apr 01 '25 18:04 Schamper