From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35434) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXxMI-0005FA-G7 for qemu-devel@nongnu.org; Fri, 04 Sep 2015 16:13:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXxMD-0006I9-47 for qemu-devel@nongnu.org; Fri, 04 Sep 2015 16:13:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50653) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXxMC-0006I2-TD for qemu-devel@nongnu.org; Fri, 04 Sep 2015 16:13:09 -0400 References: <1441395005-14907-1-git-send-email-lvivier@redhat.com> <1441395005-14907-4-git-send-email-lvivier@redhat.com> From: Eric Blake Message-ID: <55E9FB53.7070503@redhat.com> Date: Fri, 4 Sep 2015 14:13:07 -0600 MIME-Version: 1.0 In-Reply-To: <1441395005-14907-4-git-send-email-lvivier@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="bEDiTvI3Fr73n5O6hGLjbjlgritWkP03B" Subject: Re: [Qemu-devel] [PATCH v4 3/3] Use help sub-sections to create sub-help options List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier , qemu-devel@nongnu.org, marcandre.lureau@gmail.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --bEDiTvI3Fr73n5O6hGLjbjlgritWkP03B Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/04/2015 01:30 PM, Laurent Vivier wrote: > As '-help' output is 400 lines long it is not easy > to find information, but generally we know from > which area we want the information. >=20 > As sections already exist in the help description, > add some options to only display the wanted section. >=20 > '-help' now can take an optional parameter, which is > a comma separated list of sections to display: >=20 > standard display standard options > block display block options > usb display usb options > display display display options > machine display machine options > network display network options > character display character options > url display url options > bt display bt options > tpm display tpm options > kernel display kernel options > expert display expert options > object display object options >=20 > '-help' without option displays all help sections. No, that's not quite what I suggested. -help without options should display AT MOST one screen-ful: start with the usage: header (I don't know if version information has to stay, since it is also present in --version, but it doesn't hurt as it is only one line), and conclude with details about how to get more help. Or, based on your patch, it should be something like: > $ qemu-kvm -help > QEMU emulator version 2.4.50, Copyright (c) 2003-2008 Fabrice Bellard > usage: qemu-system-x86_64 [options] [disk_image] >=20 > 'disk_image' is a raw hard disk image for IDE hard disk 0 >=20 > Help/version options: > -h|-help [section][,...] > list help options. > You can provide the list of sections to display. > available sections are: > standard,block,usb,display,machine,network,character, > url,bt,tpm,kernel,expert,object > -version display version information and exit >=20 > For full details, try -help=3Dall. --help=3Dhelp (or --help=3Dsections, or whatever you name it) could be a synonym for bare --help. --help=3Dall should display ALL sections, without having to spell out eac= h section by name. And the LAST thing displayed should be the --help=3Dhel= p section (so I don't have to invoke a pager to see how to limit the output to the subsections I'm interested in). --help=3DLIST for any other comma-separated LIST should produce those particular sections. I don't care if you reorder the sections (that is, if --help=3Dblock,usb and --help=3Dusb,block produce the same output, or = if they produce sections in swapped order, is up to you). >=20 > $ x86_64-softmmu/qemu-system-x86_64 -help kernel,usb Also, I think you need '=3D' not ' ' between -help and the list; but othe= r than that, > QEMU emulator version 2.4.50, Copyright (c) 2003-2008 Fabrice Bella= rd > usage: qemu-system-x86_64 [options] [disk_image] >=20 > 'disk_image' is a raw hard disk image for IDE hard disk 0 >=20 > Linux/Multiboot boot specific: > -kernel bzImage use 'bzImage' as kernel image > -append cmdline use 'cmdline' as kernel command line > -initrd file use 'file' as initial ram disk > -dtb file use 'file' as device tree image >=20 > USB options: > -usb enable the USB driver (will be the default soon) > -usbdevice name add the host or guest USB device 'name' this is indeed a nice example of how limiting to subsections can be usefu= l. >=20 > Signed-off-by: Laurent Vivier > --- > qemu-options.hx | 120 +++++++++++++++++++++++++++++++++++++++--- > vl.c | 160 ++++++++++++++++++++++++++++++++++++++++++++++++= ++++---- > 2 files changed, 265 insertions(+), 15 deletions(-) --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --bEDiTvI3Fr73n5O6hGLjbjlgritWkP03B Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJV6ftTAAoJEKeha0olJ0Nq+OoH/1Do7086cXuI603Xzxx5/7nf WhT5tHLGQKPN68nSrWDibm/aqwWBIFCw/0Lb5CX0AVE7QwyyXlxxUiG09Daxz+qh C8YdnbyzcLzybp98uqZeFFWOcvvOklH38Am1rNpcc+YgZB7/SFnGkndQBwGwcME8 gvaSBwSzh7owm3mLEWr/zd2N1pwvOauVfwYthqOCAS7mb8Gg0Db4eD+zSirwC4WV wqYKjQPunHQhGJGY+74jxxEVKPqKUdR/4GCgHb5fyNmQy8AaFqWJKSndEdL8mBqc paCCKKf53CS6vtolU5i05rBaCOB6RQvqR5f7f+IrWi6PAygbBSOYNd4Nm0GkgGo= =Jguo -----END PGP SIGNATURE----- --bEDiTvI3Fr73n5O6hGLjbjlgritWkP03B--