All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori@us.ibm.com>
To: Eduardo Habkost <ehabkost@redhat.com>,
	Peter Maydell <peter.maydell@linaro.org>
Cc: patches@linaro.org, Michael Tokarev <mjt@tls.msk.ru>,
	Markus Armbruster <armbru@redhat.com>,
	qemu-devel@nongnu.org, Blue Swirl <blauwirbel@gmail.com>,
	Eric Blake <eblake@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3] Support 'help' as a synonym for '?' in command line options
Date: Fri, 10 Aug 2012 08:45:33 -0500	[thread overview]
Message-ID: <87r4re6ete.fsf@codemonkey.ws> (raw)
In-Reply-To: <20120809215831.GL27517@otherpad.lan.raisama.net>

Eduardo Habkost <ehabkost@redhat.com> writes:

> On Thu, Aug 09, 2012 at 10:02:22PM +0100, Peter Maydell wrote:
>> On 9 August 2012 20:25, Eduardo Habkost <ehabkost@redhat.com> wrote:
>> > On Fri, Aug 03, 2012 at 03:42:39PM -0500, Anthony Liguori wrote:
>> >> Peter Maydell <peter.maydell@linaro.org> 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

      reply	other threads:[~2012-08-10 13:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-02 12:45 [Qemu-devel] [PATCH v3] Support 'help' as a synonym for '?' in command line options Peter Maydell
2012-08-02 15:09 ` Markus Armbruster
2012-08-03 20:42 ` Anthony Liguori
2012-08-09 19:25   ` Eduardo Habkost
2012-08-09 21:02     ` Peter Maydell
2012-08-09 21:56       ` Eric Blake
2012-08-09 21:58       ` Eduardo Habkost
2012-08-10 13:45         ` Anthony Liguori [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r4re6ete.fsf@codemonkey.ws \
    --to=aliguori@us.ibm.com \
    --cc=armbru@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=eblake@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.