From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34387) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhjsQ-0007h8-R8 for qemu-devel@nongnu.org; Mon, 13 Apr 2015 15:18:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YhjsN-0006IO-So for qemu-devel@nongnu.org; Mon, 13 Apr 2015 15:18:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38319) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhjsN-0006IJ-HI for qemu-devel@nongnu.org; Mon, 13 Apr 2015 15:18:31 -0400 Message-ID: <552C165B.20001@redhat.com> Date: Mon, 13 Apr 2015 13:17:47 -0600 From: Eric Blake MIME-Version: 1.0 References: <1427995743-7865-1-git-send-email-armbru@redhat.com> <1427995743-7865-13-git-send-email-armbru@redhat.com> In-Reply-To: <1427995743-7865-13-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qJifg9Udt3F6Dp6FOBn2AlBa5RRT5Tp10" Subject: Re: [Qemu-devel] [PATCH RFC 12/19] qapi: Turn generators' mandatory option -i into an argument List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: kwolf@redhat.com, akong@redhat.com, berto@igalia.com, mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --qJifg9Udt3F6Dp6FOBn2AlBa5RRT5Tp10 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 04/02/2015 11:28 AM, Markus Armbruster wrote: > Mandatory option is silly, and the error handling is missing: the > programs crash when -i isn't supplied. Make it an argument, and check > it properly. >=20 > Signed-off-by: Markus Armbruster > --- > Makefile | 14 +++++++------- > scripts/qapi.py | 10 ++++------ > tests/Makefile | 8 ++++---- > 3 files changed, 15 insertions(+), 17 deletions(-) Needs corresponding changes to docs/qapi-code-gen.txt (several examples use --input-file=3D...). > @@ -935,8 +932,9 @@ def parse_command_line(extra_options =3D "", extra_= long_options =3D []): > do_c =3D True > do_h =3D True > =20 > - if len(args) !=3D 0: > + if len(args) !=3D 1: > print >>sys.stderr, "%s: too many arguments"% sys.argv[0] > sys.exit(1) Won't this report 'too many arguments' even for a missing argument? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --qJifg9Udt3F6Dp6FOBn2AlBa5RRT5Tp10 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/ iQEcBAEBCAAGBQJVLBZbAAoJEKeha0olJ0Nq9woIAIN1Bf6KomyeSM150k2qubdg ankRz3uwke05JHRsF5+u4qPsNK9Vxk9J0Gc5Cm6IcXALZong1FeZrN7HG1+6TuS7 +CDMu2PqAKbeQ37g1Dw80rS0iDfdaxWUC+7upVLNrJdejkv79qlOtXtalwdsn2N9 t70hT8LGYUzfuOmAzWILWOcH7eh4ULGtYOqfHl+JhIsD71nBdsuFQRRYpo5ZRkrr Szdv2oMi3B+NsFeBNX75TVpvweY+/t7vDAkIhIvdqEdqqY5ytJwRdvvVnbGRR2ZA Abx+QpT+Dhvx1Jz9fvKB19ihDGakccDJkctwPI3e2uSlSj8IxA4uL2A2A8PWcBU= =viA4 -----END PGP SIGNATURE----- --qJifg9Udt3F6Dp6FOBn2AlBa5RRT5Tp10--