From patchwork Sat Jul 20 01:44:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wayne Xia X-Patchwork-Id: 260386 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7D3862C009F for ; Sat, 20 Jul 2013 11:49:05 +1000 (EST) Received: from localhost ([::1]:43540 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0MIB-0006bX-4L for incoming@patchwork.ozlabs.org; Fri, 19 Jul 2013 21:49:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0MG5-0003mR-WF for qemu-devel@nongnu.org; Fri, 19 Jul 2013 21:46:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V0MG5-0002mO-5t for qemu-devel@nongnu.org; Fri, 19 Jul 2013 21:46:53 -0400 Received: from e28smtp03.in.ibm.com ([122.248.162.3]:52405) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0MG4-0002lH-HW for qemu-devel@nongnu.org; Fri, 19 Jul 2013 21:46:53 -0400 Received: from /spool/local by e28smtp03.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 20 Jul 2013 07:10:07 +0530 Received: from d28dlp03.in.ibm.com (9.184.220.128) by e28smtp03.in.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 20 Jul 2013 07:10:04 +0530 Received: from d28relay02.in.ibm.com (d28relay02.in.ibm.com [9.184.220.59]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id 8029D1258051 for ; Sat, 20 Jul 2013 07:16:09 +0530 (IST) Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay02.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r6K1lcU523134298 for ; Sat, 20 Jul 2013 07:17:38 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r6K1kkUd022755 for ; Sat, 20 Jul 2013 01:46:46 GMT Received: from RH63Wenchao ([9.77.181.206]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r6K1iXS1018239; Sat, 20 Jul 2013 01:46:44 GMT From: Wenchao Xia To: qemu-devel@nongnu.org Date: Sat, 20 Jul 2013 09:44:15 +0800 Message-Id: <1374284656-12025-14-git-send-email-xiawenc@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1374284656-12025-1-git-send-email-xiawenc@linux.vnet.ibm.com> References: <1374284656-12025-1-git-send-email-xiawenc@linux.vnet.ibm.com> X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13072001-3864-0000-0000-0000092AD619 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 122.248.162.3 Cc: pbonzini@redhat.com, Wenchao Xia , armbru@redhat.com, lcapitulino@redhat.com Subject: [Qemu-devel] [PATCH V7 13/13] monitor: improve auto complete of "help" for single command in sub group X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Now special case "help *" in auto completion can work with sub commands, such as "help info u*". Signed-off-by: Wenchao Xia Reviewed-by: Eric Blake --- monitor.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/monitor.c b/monitor.c index ea3ed96..95fa918 100644 --- a/monitor.c +++ b/monitor.c @@ -4314,10 +4314,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: