[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 32/36] qdev-monitor: Make device options help nicer
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 32/36] qdev-monitor: Make device options help nicer |
Date: |
Mon, 5 Nov 2018 17:37:40 +0100 |
From: Max Reitz <address@hidden>
Just like in qemu_opts_print_help(), print the device name as a caption
instead of on every single line, indent all options, add angle brackets
around types, and align the descriptions after 24 characters. Also,
separate the descriptions with " - " instead of putting them in
parentheses, because that is what we do everywhere else. This does look
a bit funny here because basically all bits have the description
"on/off", but funny does not mean it is less readable.
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
qdev-monitor.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/qdev-monitor.c b/qdev-monitor.c
index 802c18a74e..07147c63bf 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -285,10 +285,19 @@ int qdev_device_help(QemuOpts *opts)
goto error;
}
+ if (prop_list) {
+ out_printf("%s options:\n", driver);
+ } else {
+ out_printf("There are no options for %s.\n", driver);
+ }
for (prop = prop_list; prop; prop = prop->next) {
- out_printf("%s.%s=%s", driver, prop->value->name, prop->value->type);
+ int len;
+ out_printf(" %s=<%s>%n", prop->value->name, prop->value->type, &len);
if (prop->value->has_description) {
- out_printf(" (%s)\n", prop->value->description);
+ if (len < 24) {
+ out_printf("%*s", 24 - len, "");
+ }
+ out_printf(" - %s\n", prop->value->description);
} else {
out_printf("\n");
}
--
2.19.1
- [Qemu-devel] [PULL 12/36] block/vhdx: Don't take address of fields in packed structs, (continued)
- [Qemu-devel] [PULL 12/36] block/vhdx: Don't take address of fields in packed structs, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 22/36] block: Require auto-read-only for existing fallbacks, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 15/36] quorum: Return an error if the blkverify mode has invalid settings, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 30/36] option: Make option help nicer to read, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 19/36] block: Update flags in bdrv_set_read_only(), Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 31/36] chardev: Indent list of chardevs, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 18/36] iotest: Test x-blockdev-change on a Quorum, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 23/36] nbd: Support auto-read-only option, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 14/36] quorum: Remove quorum_err(), Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 11/36] vpc: Don't leak opts in vpc_open(), Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 32/36] qdev-monitor: Make device options help nicer,
Kevin Wolf <=
- [Qemu-devel] [PULL 35/36] vdi: Use a literal number of bytes for DEFAULT_CLUSTER_SIZE, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 28/36] block: Make auto-read-only=on default for -drive, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 20/36] block: Add auto-read-only option, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 34/36] fw_cfg: Drop newline in @file description, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 29/36] qemu-iotests: Test auto-read-only with -drive and -blockdev, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 24/36] file-posix: Support auto-read-only option, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 21/36] rbd: Close image in qemu_rbd_open() error path, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 26/36] gluster: Support auto-read-only option, Kevin Wolf, 2018/11/05
- [Qemu-devel] [PULL 36/36] include: Add a comment to explain the origin of sizes' lookup table, Kevin Wolf, 2018/11/05