From a23818f4ff3d7981f49453b739f589e4205930b5 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Wed, 5 Jun 2013 14:19:26 +0200 Subject: qemu-io: Remove unused args_command The original intention seems to be something with handling multiple images at once, but this has never been implemented and the only function ever registered is implemented to make everything behave like a "global" command. Just do that unconditionally now. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Signed-off-by: Stefan Hajnoczi --- cmd.c | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) (limited to 'cmd.c') diff --git a/cmd.c b/cmd.c index 10a8688b2d..4e7579b982 100644 --- a/cmd.c +++ b/cmd.c @@ -34,7 +34,6 @@ cmdinfo_t *cmdtab; int ncmds; -static argsfunc_t args_func; static checkfunc_t check_func; static int ncmdline; static char **cmdline; @@ -127,22 +126,6 @@ void add_user_command(char *optarg) cmdline[ncmdline-1] = optarg; } -static int -args_command( - int index) -{ - if (args_func) - return args_func(index); - return 0; -} - -void -add_args_command( - argsfunc_t af) -{ - args_func = af; -} - static void prep_fetchline(void *opaque) { int *fetchable = opaque; @@ -155,7 +138,7 @@ static char *get_prompt(void); void command_loop(void) { - int c, i, j = 0, done = 0, fetchable = 0, prompted = 0; + int c, i, done = 0, fetchable = 0, prompted = 0; char *input; char **v; const cmdinfo_t *ct; @@ -171,14 +154,7 @@ void command_loop(void) if (c) { ct = find_command(v[0]); if (ct) { - if (ct->flags & CMD_FLAG_GLOBAL) { - done = command(ct, c, v); - } else { - j = 0; - while (!done && (j = args_command(j))) { - done = command(ct, c, v); - } - } + done = command(ct, c, v); } else { fprintf(stderr, _("command \"%s\" not found\n"), v[0]); } -- cgit v1.2.3