From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzpY4-0004Jq-PZ for qemu-devel@nongnu.org; Fri, 10 Aug 2012 09:46:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SzpY0-0007Bw-NG for qemu-devel@nongnu.org; Fri, 10 Aug 2012 09:46:44 -0400 Received: from e6.ny.us.ibm.com ([32.97.182.146]:44023) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzpY0-0007Bj-Jd for qemu-devel@nongnu.org; Fri, 10 Aug 2012 09:46:40 -0400 Received: from /spool/local by e6.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 10 Aug 2012 09:46:39 -0400 Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [9.56.227.237]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id 7E359C90042 for ; Fri, 10 Aug 2012 09:46:33 -0400 (EDT) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q7ADkWqi155936 for ; Fri, 10 Aug 2012 09:46:33 -0400 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q7ADjb3v007928 for ; Fri, 10 Aug 2012 07:45:38 -0600 From: Anthony Liguori In-Reply-To: <20120809215831.GL27517@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> <20120809215831.GL27517@otherpad.lan.raisama.net> Date: Fri, 10 Aug 2012 08:45:33 -0500 Message-ID: <87r4re6ete.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 , Peter Maydell Cc: patches@linaro.org, Michael Tokarev , Markus Armbruster , qemu-devel@nongnu.org, Blue Swirl , Eric Blake Eduardo Habkost writes: > On Thu, Aug 09, 2012 at 10:02:22PM +0100, Peter Maydell wrote: >> 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. > > Agreed. I wasn't aware it was completely undocumented, I thought there > was documentation somewhere. > > >> 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'). > > What about "-cpu help,dump" or "-cpu help=dump"? Let's just drop the feature. I doubt a user would ever do this. For 1.3, I'd like to introduce glib option groups and allow for group specific help options. IOW, --help-cpu Regards, Anthony Liguori > > -- > Eduardo