From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnM9P-0003Sh-3x for qemu-devel@nongnu.org; Wed, 29 Apr 2015 03:11:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YnM9J-0001mh-Lp for qemu-devel@nongnu.org; Wed, 29 Apr 2015 03:11:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51364) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnM9J-0001md-GD for qemu-devel@nongnu.org; Wed, 29 Apr 2015 03:11:13 -0400 From: Markus Armbruster References: <1427995743-7865-1-git-send-email-armbru@redhat.com> <1427995743-7865-13-git-send-email-armbru@redhat.com> <552C165B.20001@redhat.com> Date: Wed, 29 Apr 2015 09:11:10 +0200 In-Reply-To: <552C165B.20001@redhat.com> (Eric Blake's message of "Mon, 13 Apr 2015 13:17:47 -0600") Message-ID: <87bni7e7e9.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain 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: Eric Blake Cc: kwolf@redhat.com, akong@redhat.com, berto@igalia.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com Eric Blake writes: > 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. >> >> 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=...). Indeed. >> @@ -935,8 +932,9 @@ def parse_command_line(extra_options = "", >> extra_long_options = []): >> do_c = True >> do_h = True >> >> - if len(args) != 0: >> + if len(args) != 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? Will fix. Thanks!