From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: Max Reitz <mreitz@redhat.com>
Cc: qemu-block <qemu-block@nongnu.org>,
qemu-devel <qemu-devel@nongnu.org>,
"Armbruster, Markus" <armbru@redhat.com>,
"Wolf, Kevin" <kwolf@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 3/5] qdev-monitor: Make device options help nicer
Date: Mon, 5 Nov 2018 12:14:53 +0400 [thread overview]
Message-ID: <CAMxuvaxPo80xnpFNPdVnDokLvwnzERFRV+tyfWDKO_TWoyiB9A@mail.gmail.com> (raw)
In-Reply-To: <20181019164929.18404-4-mreitz@redhat.com>
On Fri, Oct 19, 2018 at 8:49 PM Max Reitz <mreitz@redhat.com> wrote:
>
> 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 <mreitz@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> 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.17.1
>
next prev parent reply other threads:[~2018-11-05 8:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-19 16:49 [Qemu-devel] [PATCH v2 0/5] Various option help readability improvement suggestions Max Reitz
2018-10-19 16:49 ` [Qemu-devel] [PATCH v2 1/5] option: Make option help nicer to read Max Reitz
2018-11-05 8:14 ` Marc-André Lureau
2018-10-19 16:49 ` [Qemu-devel] [PATCH v2 2/5] chardev: Indent list of chardevs Max Reitz
2018-11-05 8:14 ` Marc-André Lureau
2018-10-19 16:49 ` [Qemu-devel] [PATCH v2 3/5] qdev-monitor: Make device options help nicer Max Reitz
2018-11-05 8:14 ` Marc-André Lureau [this message]
2018-10-19 16:49 ` [Qemu-devel] [PATCH v2 4/5] object: Make option help nicer to read Max Reitz
2018-11-05 8:15 ` Marc-André Lureau
2018-10-19 16:49 ` [Qemu-devel] [PATCH v2 5/5] fw_cfg: Drop newline in @file description Max Reitz
2018-11-05 8:15 ` Marc-André Lureau
2018-11-05 0:25 ` [Qemu-devel] [PATCH v2 0/5] Various option help readability improvement suggestions Max Reitz
2018-11-05 14:18 ` Kevin Wolf
2018-11-06 0:35 ` Max Reitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMxuvaxPo80xnpFNPdVnDokLvwnzERFRV+tyfWDKO_TWoyiB9A@mail.gmail.com \
--to=marcandre.lureau@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).