aboutsummaryrefslogtreecommitdiff
path: root/cmd.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2013-06-05 14:19:26 +0200
committerStefan Hajnoczi <stefanha@redhat.com>2013-06-06 11:27:03 +0200
commita23818f4ff3d7981f49453b739f589e4205930b5 (patch)
tree3453fa37fece548b66089f4ac2d96f8bf7752b85 /cmd.c
parent293c51a6ee369228633a8428ab689f14c045ff98 (diff)
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 <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'cmd.c')
-rw-r--r--cmd.c28
1 files changed, 2 insertions, 26 deletions
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]);
}