From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38316) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwE0P-0004I8-KT for qemu-devel@nongnu.org; Mon, 08 Jul 2013 12:09:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UwE0O-0000m4-LK for qemu-devel@nongnu.org; Mon, 08 Jul 2013 12:09:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42121) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwE0O-0000lz-Dw for qemu-devel@nongnu.org; Mon, 08 Jul 2013 12:09:36 -0400 Date: Mon, 8 Jul 2013 12:09:10 -0400 From: Luiz Capitulino Message-ID: <20130708120910.7eac11f8@redhat.com> In-Reply-To: <1372477981-7512-7-git-send-email-xiawenc@linux.vnet.ibm.com> References: <1372477981-7512-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1372477981-7512-7-git-send-email-xiawenc@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH V5 6/7] monitor: improve "help" in auto completion for sub command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com On Sat, 29 Jun 2013 11:53:00 +0800 Wenchao Xia wrote: > Now special case "help *" in auto completion can work with sub commands, > such as "help info a*". The auto-completion works, but the command is still refused: (qemu) help info u usb usbhost usernet uuid (qemu) help info uuid help: extraneous characters at the end of line This is not hugely important, but I think it would make more sense to make the command work before having auto-completion support. > > Signed-off-by: Wenchao Xia > --- > monitor.c | 6 ++---- > 1 files changed, 2 insertions(+), 4 deletions(-) > > diff --git a/monitor.c b/monitor.c > index 2f5b91d..3ef18ee 100644 > --- a/monitor.c > +++ b/monitor.c > @@ -4283,10 +4283,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 = mon->cmd_table; cmd->name != NULL; cmd++) { > - cmd_completion(mon, str, cmd->name); > - } > + monitor_find_completion_by_table(mon, cmd_table, > + args_cmdline[1]); > } > break; > default: