From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46204) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzZs8-0007q2-J9 for qemu-devel@nongnu.org; Thu, 09 Aug 2012 17:02:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SzZs7-0007nh-I7 for qemu-devel@nongnu.org; Thu, 09 Aug 2012 17:02:24 -0400 Received: from mail-gg0-f173.google.com ([209.85.161.173]:40335) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzZs7-0007nd-Df for qemu-devel@nongnu.org; Thu, 09 Aug 2012 17:02:23 -0400 Received: by ggna5 with SMTP id a5so910180ggn.4 for ; Thu, 09 Aug 2012 14:02:22 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20120809192553.GA2603@otherpad.lan.raisama.net> References: <1343911554-11109-1-git-send-email-peter.maydell@linaro.org> <878vdvvha8.fsf@codemonkey.ws> <20120809192553.GA2603@otherpad.lan.raisama.net> Date: Thu, 9 Aug 2012 22:02:22 +0100 Message-ID: From: Peter Maydell Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v3] Support 'help' as a synonym for '?' in command line options List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Anthony Liguori , patches@linaro.org, Michael Tokarev , Markus Armbruster , qemu-devel@nongnu.org, Blue Swirl , Eric Blake On 9 August 2012 20:25, Eduardo Habkost wrote: > On Fri, Aug 03, 2012 at 03:42:39PM -0500, Anthony Liguori wrote: >> Peter Maydell writes: >> > For command line options which permit '?' meaning 'please list the >> > permitted values', add support for 'help' as a synonym, by abstracting >> > the check out into a helper function. >> Applied. Thanks. > > I just found out that this patch broke "-cpu ?dump", "-cpu ?cpuid", and > "-cpu ?model": These options appear to be completely undocumented. They're also pretty ugly syntax and seem to be x86 specific. However we can unbreak them if we must with a patch like this: --- a/vl.c +++ b/vl.c @@ -3215,7 +3215,11 @@ int main(int argc, char **argv, char **envp) */ cpudef_init(); - if (cpu_model && is_help_option(cpu_model)) { + /* We have to check for "starts with '?' as well as is_help_option + * to support targets which implement various weird help options + * via '?thingy' syntax. + */ + if (cpu_model && (is_help_option(cpu_model) || *cpu_model == '?')) { list_cpus(stdout, &fprintf, cpu_model); exit(0); } (will send as a proper patch with commit message and signoff tomorrow). Any suggestions for what the sane syntax for these options would be? (ie the analogous change to having '?' go to 'help'). -- PMM