From patchwork Tue Aug 27 12:38:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wayne Xia X-Patchwork-Id: 270117 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 42A892C00BC for ; Tue, 27 Aug 2013 22:49:08 +1000 (EST) Received: from localhost ([::1]:56235 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEIhm-00031s-9f for incoming@patchwork.ozlabs.org; Tue, 27 Aug 2013 08:49:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38940) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEIaE-00082A-HV for qemu-devel@nongnu.org; Tue, 27 Aug 2013 08:41:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VEIa5-0000ZB-K8 for qemu-devel@nongnu.org; Tue, 27 Aug 2013 08:41:18 -0400 Received: from e23smtp05.au.ibm.com ([202.81.31.147]:54512) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEIa5-0000Y3-0J for qemu-devel@nongnu.org; Tue, 27 Aug 2013 08:41:09 -0400 Received: from /spool/local by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 27 Aug 2013 22:33:51 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp05.au.ibm.com (202.81.31.211) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 27 Aug 2013 22:33:49 +1000 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [9.190.235.21]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 3CC602CE804C for ; Tue, 27 Aug 2013 22:41:05 +1000 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r7RCeslc66584598 for ; Tue, 27 Aug 2013 22:40:54 +1000 Received: from d23av01.au.ibm.com (localhost [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r7RCf436032260 for ; Tue, 27 Aug 2013 22:41:04 +1000 Received: from RH63Wenchao.localdomain ([9.77.176.7]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id r7RCc3nB029119; Tue, 27 Aug 2013 22:41:02 +1000 From: Wenchao Xia To: qemu-devel@nongnu.org Date: Tue, 27 Aug 2013 20:38:27 +0800 Message-Id: <1377607107-11612-16-git-send-email-xiawenc@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1377607107-11612-1-git-send-email-xiawenc@linux.vnet.ibm.com> References: <1377607107-11612-1-git-send-email-xiawenc@linux.vnet.ibm.com> X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13082712-1396-0000-0000-000003762429 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 202.81.31.147 Cc: Wenchao Xia , armbru@redhat.com, lcapitulino@redhat.com Subject: [Qemu-devel] [PATCH V10 15/15] 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 81f41e6..8d07f9c 100644 --- a/monitor.c +++ b/monitor.c @@ -4329,10 +4329,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: