Skip to content

Commit

Permalink
monitor: improve auto complete of "help" for single command in sub group
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wenchao Xia authored and Luiz Capitulino committed Aug 30, 2013
1 parent 129be00 commit 7ca0e06
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions monitor.c
Expand Up @@ -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:
Expand Down

0 comments on commit 7ca0e06

Please sign in to comment.