From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:43373) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQoXJ-0005mV-Nf for qemu-devel@nongnu.org; Sun, 29 May 2011 18:32:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QQoXI-00026d-UH for qemu-devel@nongnu.org; Sun, 29 May 2011 18:32:41 -0400 Received: from mail-pw0-f45.google.com ([209.85.160.45]:43102) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQoXI-00026X-Ml for qemu-devel@nongnu.org; Sun, 29 May 2011 18:32:40 -0400 Received: by pwi6 with SMTP id 6so1533286pwi.4 for ; Sun, 29 May 2011 15:32:39 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1306707770-14632-3-git-send-email-cerbere@gmail.com> References: <1306707770-14632-1-git-send-email-cerbere@gmail.com> <1306707770-14632-3-git-send-email-cerbere@gmail.com> Date: Sun, 29 May 2011 23:32:39 +0100 Message-ID: From: Peter Maydell Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH V2 2/3] Cocoa: avoid displaying window when command-line contains '-h' or '-help' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexandre Raymond Cc: andreas.faerber@web.de, qemu-devel@nongnu.org On 29 May 2011 23:22, Alexandre Raymond wrote: > diff --git a/ui/cocoa.m b/ui/cocoa.m > index 1ff1ac6..e1312d3 100644 > --- a/ui/cocoa.m > +++ b/ui/cocoa.m > @@ -872,7 +872,8 @@ int main (int argc, const char * argv[]) { > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (opt[1] =3D=3D '-') { > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 opt++; > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 } > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (!strcmp(opt, "-vnc") || > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (!strcmp(opt, "-h") || !str= cmp(opt, "-help") || > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0!strcmp(opt, "-v= nc") || > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 !strcmp(opt, "-no= graphic") || > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 !strcmp(opt, "-ve= rsion") || > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 !strcmp(opt, "-cu= rses")) { (1) presumably this doesn't work if you disable the display with "-display none" ? (2) it's pretty ugly and not very maintainable -- is there some restructuring possible to avoid having to hardcode information about qemu options into the ui code here? (It also doesn't catch other cases where qemu prints some information and exits immediately, like "-cpu ?".) -- PMM