From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:40868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWIKZ-00085Z-54 for qemu-devel@nongnu.org; Mon, 13 Jun 2011 21:22:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QWIKX-0003eo-Vy for qemu-devel@nongnu.org; Mon, 13 Jun 2011 21:22:11 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:59332) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWIKX-0003eb-OT for qemu-devel@nongnu.org; Mon, 13 Jun 2011 21:22:09 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Tue, 14 Jun 2011 03:21:58 +0200 Message-Id: <1308014527-60251-2-git-send-email-andreas.faerber@web.de> In-Reply-To: <1308014527-60251-1-git-send-email-andreas.faerber@web.de> References: <1308014527-60251-1-git-send-email-andreas.faerber@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: andreas.faerber@web.de Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 01/10] cocoa: do not create a spurious window for -version List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , Tristan Gingold From: Tristan Gingold When invoked with -version, qemu will exit just after displaying the vers= ion, so there is no need to create a window. Also handles --XXX options. Signed-off-by: Tristan Gingold Signed-off-by: Andreas F=C3=A4rber --- ui/cocoa.m | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 20f91bc..1ff1ac6 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -865,10 +865,19 @@ int main (int argc, const char * argv[]) { =20 /* In case we don't need to display a window, let's not do that */ for (i =3D 1; i < argc; i++) { - if (!strcmp(argv[i], "-vnc") || - !strcmp(argv[i], "-nographic") || - !strcmp(argv[i], "-curses")) { + const char *opt =3D argv[i]; + + if (opt[0] =3D=3D '-') { + /* Treat --foo the same as -foo. */ + if (opt[1] =3D=3D '-') { + opt++; + } + if (!strcmp(opt, "-vnc") || + !strcmp(opt, "-nographic") || + !strcmp(opt, "-version") || + !strcmp(opt, "-curses")) { return qemu_main(gArgc, gArgv); + } } } =20 --=20 1.7.5.3