[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 15/19] Expand query-argv to include help string
From: |
Daniel P. Berrange |
Subject: |
[Qemu-devel] [PATCH 15/19] Expand query-argv to include help string |
Date: |
Mon, 7 Jun 2010 15:42:28 +0100 |
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 <address@hidden>
---
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
- [Qemu-devel] Re: [PATCH 14/19] Add a query-argv command to QMP, (continued)
[Qemu-devel] [PATCH 13/19] Add a query-target command to QMP, Daniel P. Berrange, 2010/06/07
[Qemu-devel] [PATCH 15/19] Expand query-argv to include help string,
Daniel P. Berrange <=
[Qemu-devel] [PATCH 18/19] Add option to turn on JSON pretty printing in monitor, Daniel P. Berrange, 2010/06/07
[Qemu-devel] [PATCH 17/19] Add a query-config command to QMP, Daniel P. Berrange, 2010/06/07
[Qemu-devel] [PATCH 16/19] Add a query-netdev command to QMP, Daniel P. Berrange, 2010/06/07
[Qemu-devel] [PATCH 19/19] Add a -capabilities argument to allow easy query for static QEMU info, Daniel P. Berrange, 2010/06/07