From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: "Daniel P. Berrange" 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> Subject: [Qemu-devel] [PATCH 15/19] Expand query-argv to include help string List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@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); } -- 1.6.6.1