qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH V2 2/3] Cocoa: avoid displaying window when comm


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH V2 2/3] Cocoa: avoid displaying window when command-line contains '-h' or '-help'
Date: Sun, 29 May 2011 23:32:39 +0100

On 29 May 2011 23:22, Alexandre Raymond <address@hidden> 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[]) {
>             if (opt[1] == '-') {
>                 opt++;
>             }
> -            if (!strcmp(opt, "-vnc") ||
> +            if (!strcmp(opt, "-h") || !strcmp(opt, "-help") ||
> +                !strcmp(opt, "-vnc") ||
>                 !strcmp(opt, "-nographic") ||
>                 !strcmp(opt, "-version") ||
>                 !strcmp(opt, "-curses")) {

(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



reply via email to

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