diff options
author | Tristan Gingold <gingold@adacore.com> | 2011-03-15 14:18:22 +0100 |
---|---|---|
committer | Andreas Färber <andreas.faerber@web.de> | 2011-06-14 03:08:56 +0200 |
commit | e4ebcc1a37a7e66205f477a7d2805fb5d0ce3d3b (patch) | |
tree | f70097e6b644c6ec7f4d3dfaf0abf16b72b8014a /ui | |
parent | 0b862cedf36d927818c50584ddd611b0370673df (diff) |
cocoa: do not create a spurious window for -version
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 <gingold@adacore.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/cocoa.m | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/ui/cocoa.m b/ui/cocoa.m index 20f91bc642..1ff1ac641f 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); + } } } |