diff options
Diffstat (limited to 'cmd-run-shell.c')
-rw-r--r-- | cmd-run-shell.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/cmd-run-shell.c b/cmd-run-shell.c index 9ec79abc..09d0bd38 100644 --- a/cmd-run-shell.c +++ b/cmd-run-shell.c @@ -1,4 +1,4 @@ -/* $Id: cmd-run-shell.c,v 1.9 2010-08-09 21:44:25 tcunha Exp $ */ +/* $Id: cmd-run-shell.c,v 1.10 2011-01-07 14:45:34 tcunha Exp $ */ /* * Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org> @@ -35,13 +35,12 @@ void cmd_run_shell_free(void *); const struct cmd_entry cmd_run_shell_entry = { "run-shell", "run", + "", 1, 1, "command", - CMD_ARG1, "", - cmd_target_init, - cmd_target_parse, - cmd_run_shell_exec, - cmd_target_free, - cmd_target_print + 0, + NULL, + NULL, + cmd_run_shell_exec }; struct cmd_run_shell_data { @@ -52,12 +51,12 @@ struct cmd_run_shell_data { int cmd_run_shell_exec(struct cmd *self, struct cmd_ctx *ctx) { - struct cmd_target_data *data = self->data; + struct args *args = self->args; struct cmd_run_shell_data *cdata; struct job *job; cdata = xmalloc(sizeof *cdata); - cdata->cmd = xstrdup(data->arg); + cdata->cmd = xstrdup(args->argv[0]); memcpy(&cdata->ctx, ctx, sizeof cdata->ctx); if (ctx->cmdclient != NULL) @@ -66,7 +65,7 @@ cmd_run_shell_exec(struct cmd *self, struct cmd_ctx *ctx) ctx->curclient->references++; job = job_add(NULL, 0, NULL, - data->arg, cmd_run_shell_callback, cmd_run_shell_free, cdata); + args->argv[0], cmd_run_shell_callback, cmd_run_shell_free, cdata); job_run(job); return (1); /* don't let client exit */ |