From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39099) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJa2O-0005j5-KB for qemu-devel@nongnu.org; Mon, 05 Nov 2018 03:15:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJa2L-0006Sv-DQ for qemu-devel@nongnu.org; Mon, 05 Nov 2018 03:15:08 -0500 Received: from mail-qk1-f196.google.com ([209.85.222.196]:34288) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gJa2L-0006SL-90 for qemu-devel@nongnu.org; Mon, 05 Nov 2018 03:15:05 -0500 Received: by mail-qk1-f196.google.com with SMTP id a132so13271603qkg.1 for ; Mon, 05 Nov 2018 00:15:05 -0800 (PST) MIME-Version: 1.0 References: <20181019164929.18404-1-mreitz@redhat.com> <20181019164929.18404-4-mreitz@redhat.com> In-Reply-To: <20181019164929.18404-4-mreitz@redhat.com> From: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= Date: Mon, 5 Nov 2018 12:14:53 +0400 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 3/5] qdev-monitor: Make device options help nicer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: qemu-block , qemu-devel , "Armbruster, Markus" , "Wolf, Kevin" On Fri, Oct 19, 2018 at 8:49 PM Max Reitz 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 Reviewed-by: Marc-Andr=C3=A9 Lureau > --- > 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 =3D prop_list; prop; prop =3D prop->next) { > - out_printf("%s.%s=3D%s", driver, prop->value->name, prop->value-= >type); > + int len; > + out_printf(" %s=3D<%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 >