qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] cocoa: do not create a spurious window for -ver


From: Tristan Gingold
Subject: Re: [Qemu-devel] [PATCH] cocoa: do not create a spurious window for -version
Date: Mon, 21 Mar 2011 09:30:09 +0100

On Mar 19, 2011, at 2:44 PM, Andreas Färber wrote:

> Hello Tristan,
> 
> Am 15.03.2011 um 14:18 schrieb 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 <address@hidden>
> 
> Looks good to me except for the qemu_main() indentation.

Ah.  Sorry for the nit.

> Should I fix it and enqueue it on my cocoa branch for the next pull?

Yes please.

> Just wondering, since when do we support -- options?

No idea.  Wasn't aware of that before someone else in our company used this 
flag.

Thanks,
Tristan.

> 
> Andreas
> 
>> ---
>> 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);
>> +            }
>>        }
>>    }
>> 
>> -- 
>> 1.7.3.GIT
>> 
>> 
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]