summaryrefslogtreecommitdiff
path: root/wrapper/runcom.c
diff options
context:
space:
mode:
authorLuke Shumaker <luke@HP-dv6426us-u904.(none)>2009-10-28 21:43:58 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-06-26 00:30:18 -0600
commit3ab15374b7ea2278a578e5f2ac13b0c012b58b57 (patch)
treee6d1454e76b42ab69f51294b1f7c722495fd71f3 /wrapper/runcom.c
parentbff2fcdc214d1aafc10afa8572aa66757a2f95dc (diff)
add support for running a command from a specific plugin to runcom
this feature should only be used internally by plugins
Diffstat (limited to 'wrapper/runcom.c')
-rw-r--r--wrapper/runcom.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/wrapper/runcom.c b/wrapper/runcom.c
index 10e9919..5928bb3 100644
--- a/wrapper/runcom.c
+++ b/wrapper/runcom.c
@@ -40,7 +40,20 @@ main ( int argc, char *argv[] )
struct plugin *plugins;
plugins=load_plugins(stdin);
struct plugin_command_list *list;
- list=plugin_find_commands(plugins,argv[1]);
+ if ( strchr(argv[1],'/') == NULL )
+ list=plugin_find_commands(plugins,argv[1]);
+ else {
+ /* this is a command for a specific plugin */
+ list=xmalloc(sizeof(*list));
+ list->command=plugin_depend_parse(stralloc(argv[1]));
+ list->next=NULL;
+ if ( list->command == NULL ) {
+ /* plugin_depend_parse should fail the program*\
+ \* on its own, but just to be safe... */
+ plugin_free_list(list);
+ list=NULL;
+ }
+ }
if (list==NULL)
error(EXIT_FAILURE,0,"unrecognized command `%s'",
argv[1]);