From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXwsG-0005nw-JW for qemu-devel@nongnu.org; Fri, 04 Sep 2015 15:42:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXwsD-0006OP-D7 for qemu-devel@nongnu.org; Fri, 04 Sep 2015 15:42:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43727) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXwsD-0006O2-7k for qemu-devel@nongnu.org; Fri, 04 Sep 2015 15:42:09 -0400 References: <1441395005-14907-1-git-send-email-lvivier@redhat.com> <1441395005-14907-2-git-send-email-lvivier@redhat.com> From: Eric Blake Message-ID: <55E9F40E.4010705@redhat.com> Date: Fri, 4 Sep 2015 13:42:06 -0600 MIME-Version: 1.0 In-Reply-To: <1441395005-14907-2-git-send-email-lvivier@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="EBcdoc1tRkOJEmIbmXCPl9K5BJGuB3rOk" Subject: Re: [Qemu-devel] [PATCH v4 1/3] vl: Add a flags to define parameters with optional arguments. 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) --EBcdoc1tRkOJEmIbmXCPl9K5BJGuB3rOk Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/04/2015 01:30 PM, Laurent Vivier wrote: > The goal is to be able to use '-help' alone, or with > a sub-section, i.e. '-help network,usb'. Uggh. I hate reinventing the wheel. We aren't using getopt_long_only(); but if we were, the ONLY way to specify optional arguments to a long option is by using the =3D sign, and not by space separation. That is, '-help=3Dnetwork,usb' would work, but '-help network,usb' would NOT be seen as arguments to -help. While I'd really rather we just use getopt_long_only(), that's a much bigger change. But we should at least mirror its semantics, because it is VERY confusing to have subtly different command-line behavior than most apps out there. >=20 > Signed-off-by: Laurent Vivier > --- > vl.c | 20 +++++++++++++++----- > 1 file changed, 15 insertions(+), 5 deletions(-) >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --EBcdoc1tRkOJEmIbmXCPl9K5BJGuB3rOk 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/ iQEcBAEBCAAGBQJV6fQOAAoJEKeha0olJ0NqzNAH/RIxp5YceffCR8gjRik1Vedb /buUQAN9EkCPV77uTxIsb0Jrtvtjcbhsx+xenRdBAFFk3REgYfGO6u53IPVLfRby 7CdI2bMjmaP/q8UIjoClUGHyupvFx8/E3CsXoMO31dGzoxRZOLFxX8xwbEyD0c0Q lY6HZHC76vRF7dAX/HReqJTLSARriqRyrJkFo73G2vQM6L657UahN+w85ODWXZwY fr7hTot5DfAWvgv+yfqxN0Hog71pJiaqr6PQ6/1llT3anmuqJ1eCTu6dnN9aYmIW oVFB38koiEjVdMi7GlQs7nvzC6smdpK2TsfSvkgqo+UfO6sMLLfsQR8Qya2hkw0= =sjw5 -----END PGP SIGNATURE----- --EBcdoc1tRkOJEmIbmXCPl9K5BJGuB3rOk--