From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwoBF-0004pk-RU for qemu-devel@nongnu.org; Wed, 10 Jul 2013 02:47:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UwoBF-00054k-1p for qemu-devel@nongnu.org; Wed, 10 Jul 2013 02:47:13 -0400 Received: from e23smtp05.au.ibm.com ([202.81.31.147]:38325) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwoBE-00054G-Dl for qemu-devel@nongnu.org; Wed, 10 Jul 2013 02:47:12 -0400 Received: from /spool/local by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 10 Jul 2013 16:40:46 +1000 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [9.190.235.152]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 8CE152CE8052 for ; Wed, 10 Jul 2013 16:47:06 +1000 (EST) Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r6A6Vo8f7209446 for ; Wed, 10 Jul 2013 16:31:50 +1000 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r6A6l5Kh009760 for ; Wed, 10 Jul 2013 16:47:05 +1000 Message-ID: <51DD035F.9000507@linux.vnet.ibm.com> Date: Wed, 10 Jul 2013 14:46:55 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1372477981-7512-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1372477981-7512-7-git-send-email-xiawenc@linux.vnet.ibm.com> <20130708120910.7eac11f8@redhat.com> In-Reply-To: <20130708120910.7eac11f8@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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: Luiz Capitulino Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com 于 2013-7-9 0:09, Luiz Capitulino 写道: > 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. > Patch 7 fix it, I will adjust the patch sequence. >> >> 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: > -- Best Regards Wenchao Xia