From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54951) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfuKD-0007Jw-Sv for qemu-devel@nongnu.org; Tue, 04 Dec 2012 10:22:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TfuK8-0005np-0b for qemu-devel@nongnu.org; Tue, 04 Dec 2012 10:22:21 -0500 Received: from mail-ee0-f45.google.com ([74.125.83.45]:34470) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfuK7-0005mL-Pq for qemu-devel@nongnu.org; Tue, 04 Dec 2012 10:22:15 -0500 Received: by mail-ee0-f45.google.com with SMTP id d49so2480444eek.4 for ; Tue, 04 Dec 2012 07:22:14 -0800 (PST) Date: Tue, 4 Dec 2012 16:22:10 +0100 From: Stefan Hajnoczi Message-ID: <20121204152210.GA30009@stefanha-thinkpad.redhat.com> References: <546629445.6245807.1354003408224.JavaMail.root@redhat.com> <1649739967.10174371.1354619215533.JavaMail.root@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1649739967.10174371.1354619215533.JavaMail.root@redhat.com> Subject: Re: [Qemu-devel] [PATCH v5] Add compare subcommand for qemu-img List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Miroslav Rezanina Cc: Kevin Wolf , Paolo Bonzini , qemu-devel@nongnu.org, Stefan Hajnoczi On Tue, Dec 04, 2012 at 06:06:55AM -0500, Miroslav Rezanina wrote: > + for (;;) { > + c = getopt(argc, argv, "pf:F:sq"); > + if (c == -1) { > + break; > + } > + switch (c) { > + case 'f': > + fmt1 = optarg; > + break; > + case 'F': > + fmt2 = optarg; > + break; > + case 'p': > + progress = 1; > + break; > + case 'q': > + quiet = 1; > + break; > + case 's': > + strict = 1; > + break; > + } > + } Still missing '?' and 'h'. They should call help(). Without this an invalid command-line option doesn't abort execution and weird things can happen :). Stefan