Now that we have basic plugins support, the next thing we could do in order to improve them is to provide a way that plugins also act as commands invoked by 'pkg '
The way such plugins would work is to register a hook (e.g. PKG_PLUGINS_HOOK_IS_COMMAND) and be invoked by pkg during command resolution.
Callbacks should have the following prototype:
int plugin_sample_exec(int argc, char **argv)
Arguments are passed similar to what we already do with the other *_exec() functions.
Support for running external programs (e.g. shell scripts) could be added in a later phase as well.
Support for adding new commands provided by plugins has been committed.
Example plugin providing a new command can be found below:
Please make sure the library do not know about the frontend and therefor you have to find a smart way to extend the plugins interface of the lib from the frontend :)
this is in ;)