From patchwork Mon Jun 7 14:42:28 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 54879 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A78FBB7D1F for ; Tue, 8 Jun 2010 01:23:38 +1000 (EST) Received: from localhost ([127.0.0.1]:47945 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OLeAn-0007KP-Rg for incoming@patchwork.ozlabs.org; Mon, 07 Jun 2010 11:23:33 -0400 Received: from [140.186.70.92] (port=56388 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OLdYV-0005xl-HK for qemu-devel@nongnu.org; Mon, 07 Jun 2010 10:44:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OLdY3-0005Fn-Oa for qemu-devel@nongnu.org; Mon, 07 Jun 2010 10:43:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42887) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OLdY3-0005FX-HO for qemu-devel@nongnu.org; Mon, 07 Jun 2010 10:43:31 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o57EhUAO009341 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 7 Jun 2010 10:43:30 -0400 Received: from localhost.localdomain (dhcp-1-192.lcy.redhat.com [10.32.224.192]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o57EgrCg031909; Mon, 7 Jun 2010 10:43:29 -0400 From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Mon, 7 Jun 2010 15:42:28 +0100 Message-Id: <1275921752-29420-16-git-send-email-berrange@redhat.com> In-Reply-To: <1275921752-29420-1-git-send-email-berrange@redhat.com> References: <1275921752-29420-1-git-send-email-berrange@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Subject: [Qemu-devel] [PATCH 15/19] Expand query-argv to include help string X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This expands the query-argv data format to include the help string for each argument. This is not really very desirable since the help strings are not in a predictable format for apps to use. Ideally the full structured details about each argument parameter would be included instead. This makes the data format look like [ { "name": "help", "help": "-h or -help display this help and exit\n", }, { "name": "M", "help": "-M machine select emulated machine (-M ? for list)\n", "parameters": [ ] }, ] Signed-off-by: Daniel P. Berrange --- vl.c | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/vl.c b/vl.c index a76c673..35d2b51 100644 --- a/vl.c +++ b/vl.c @@ -2030,14 +2030,14 @@ void do_info_argv(Monitor *mon, QObject **data) const char *help; } options_help[] = { #define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \ - { option, opt_arg }, + { option, opt_arg, opt_help }, #define DEFHEADING(text) #define HAS_ARG 1 #include "qemu-options.h" #undef DEF #undef DEFHEADING #undef HAS_ARG - { NULL, 0 }, + { NULL, 0, NULL }, }; int i; @@ -2046,14 +2046,15 @@ void do_info_argv(Monitor *mon, QObject **data) if (options_help[i].has_arg) { /* XXX actually fill in the parameter details */ - opt = qobject_from_jsonf("{ 'name': %s, 'parameters': [] }", - options_help[i].name); + opt = qobject_from_jsonf("{ 'name': %s, 'help': %s, 'parameters': [] }", + options_help[i].name, + options_help[i].help); } else { - opt = qobject_from_jsonf("{ 'name': %s }", - options_help[i].name); + opt = qobject_from_jsonf("{ 'name': %s, 'help': %s }", + options_help[i].name, + options_help[i].help); } - qlist_append_obj(args, opt); }