I agree that this is not the best way to handle all cases not requiring a GUI.
However, due to the current structure of the code, it was a simple way to cover a very common case without having to refactor the whole cocoa code. Alexandre On Sun, May 29, 2011 at 6:32 PM, Peter Maydell <peter.mayd...@linaro.org> wrote: > On 29 May 2011 23:22, Alexandre Raymond <cerb...@gmail.com> 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 >