From patchwork Tue Jun 14 01:21:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 100213 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C3FCAB6FAB for ; Tue, 14 Jun 2011 11:25:40 +1000 (EST) Received: from localhost ([::1]:46428 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWINr-00085z-0E for incoming@patchwork.ozlabs.org; Mon, 13 Jun 2011 21:25:35 -0400 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 Received: from smtp08.web.de ( [172.20.5.216]) by fmmailgate03.web.de (Postfix) with ESMTP id D65CF19234390; Tue, 14 Jun 2011 03:22:08 +0200 (CEST) Received: from [87.173.124.240] (helo=af.local) by smtp08.web.de with asmtp (WEB.DE 4.110 #2) id 1QWIKW-0002ji-01; Tue, 14 Jun 2011 03:22:08 +0200 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Tue, 14 Jun 2011 03:21:58 +0200 Message-Id: <1308014527-60251-2-git-send-email-andreas.faerber@web.de> X-Mailer: git-send-email 1.7.5.3 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 X-Sender: Andreas.Faerber@web.de X-Provags-ID: V01U2FsdGVkX1+isyGxjcpqCdmOsjx5UjR8FkbnGNHFmXoR2Q0R WNRWmQZFgV3TEPuj/9wjs6SjCvgYWmb5aQVCZH69icBhEdao7z ZNKZ76pHMYmMNGitir9g== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 217.72.192.234 Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , Tristan Gingold Subject: [Qemu-devel] [PATCH 01/10] cocoa: do not create a spurious window for -version X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Tristan Gingold When invoked with -version, qemu will exit just after displaying the version, so there is no need to create a window. Also handles --XXX options. Signed-off-by: Tristan Gingold Signed-off-by: Andreas Färber --- 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[]) { /* In case we don't need to display a window, let's not do that */ for (i = 1; i < argc; i++) { - if (!strcmp(argv[i], "-vnc") || - !strcmp(argv[i], "-nographic") || - !strcmp(argv[i], "-curses")) { + const char *opt = argv[i]; + + if (opt[0] == '-') { + /* Treat --foo the same as -foo. */ + if (opt[1] == '-') { + opt++; + } + if (!strcmp(opt, "-vnc") || + !strcmp(opt, "-nographic") || + !strcmp(opt, "-version") || + !strcmp(opt, "-curses")) { return qemu_main(gArgc, gArgv); + } } }