Extend plugin support by allowing plugins to run as commands #342

Closed
dnaeon opened this Issue Sep 1, 2012 · 4 comments

Projects

None yet

3 participants

@dnaeon
Contributor
dnaeon commented Sep 1, 2012

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.

@bdrewery
Member
bdrewery commented Sep 1, 2012

👍

@dnaeon
Contributor
dnaeon commented Sep 3, 2012

Support for adding new commands provided by plugins has been committed.

Example plugin providing a new command can be found below:

@bapt
Member
bapt commented Sep 3, 2012

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 :)

@bapt
Member
bapt commented Nov 29, 2013

this is in ;)

@bapt bapt closed this Nov 29, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment