aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWenchao Xia <xiawenc@linux.vnet.ibm.com>2013-08-27 20:38:27 +0800
committerLuiz Capitulino <lcapitulino@redhat.com>2013-08-30 07:41:15 -0400
commit7ca0e061044615e39eab2b22b8fc2791a4d77c34 (patch)
treefeb0c82cfd976efe4c5e4b4c1508673a3bfec890
parent129be006d63ba90b788de6b1610892e02ef5eaba (diff)
monitor: improve auto complete of "help" for single command in sub group
Now special case "help *" in auto completion can work with sub commands, such as "help info u*". Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
-rw-r--r--monitor.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/monitor.c b/monitor.c
index 721c74d273..0aeaf6c56b 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4330,10 +4330,8 @@ static void monitor_find_completion_by_table(Monitor *mon,
cmd_completion(mon, str, QKeyCode_lookup[i]);
}
} else if (!strcmp(cmd->name, "help|?")) {
- readline_set_completion_index(mon->rs, strlen(str));
- for (cmd = cmd_table; cmd->name != NULL; cmd++) {
- cmd_completion(mon, str, cmd->name);
- }
+ monitor_find_completion_by_table(mon, cmd_table,
+ &args[1], nb_args - 1);
}
break;
default: