qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Markus Armbruster <armbru@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	patches@linaro.org, Michael Tokarev <mjt@tls.msk.ru>,
	qemu-devel@nongnu.org, Blue Swirl <blauwirbel@gmail.com>,
	Eric Blake <eblake@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2] Support 'help' as a synonym for '?' in command line options
Date: Thu, 2 Aug 2012 10:10:04 +0100	[thread overview]
Message-ID: <CAFEAcA9138s55ChpeUEbacfFwv5JCG_p4z_MwYEyJmfLFzrLuA@mail.gmail.com> (raw)
In-Reply-To: <87mx2dy8c0.fsf@blackfin.pond.sub.org>

On 2 August 2012 10:03, Markus Armbruster <armbru@redhat.com> wrote:
>> -    if (*optarg == '?') {
>> +    if (is_help_option(optarg)) {
>>      show_valid_cards:
>
> "-soundhw ?junk" now goes through the "bad card name" path instead of
> the "help" path.  Fine with me.

Yeah, I assumed that treating '?junk' like '?' was basically a bug
due to lazy coding, but I should call it out in the commit message
as a behaviour change I guess.

>> @@ -825,8 +825,8 @@ int main(int argc, char **argv)
>>              qemu_uname_release = argv[optind++];
>>          } else if (!strcmp(r, "cpu")) {
>>              cpu_model = argv[optind++];
>> -            if (strcmp(cpu_model, "?") == 0) {
>> -/* XXX: implement xxx_cpu_list for targets that still miss it */
>> +            if (is_help_option(cpu_model)) {
>> +                /* XXX: implement xxx_cpu_list for targets that still miss it */
>
> I wouldn't reindent this line.

I have a feeling checkpatch complained or I probably wouldn't have.
I'll put it back though.

>
>        if (!driver || !qemu_opt_get(opts, "?")) {
>            return 0;
>        }
>
> I'm afraid you missed this one.  Please test both
>
>     -device \?
>     -device e1000,\?
>
> as well as
>
>     -device i6300esb
>     -device i6300esb,addr=9
>     -device i6300esb,romfile=\?
>
> The last one is expected to fail (failed to find romfile "?").

OK.

>> + * Check whether @s is one of the standard strings which indicate
>> + * that the user is asking for a list of the valid values for a
>> + * command option like -cpu or -M. The current accepted strings
>> + * are 'help' and '?'.
>
> Good opportunity to document that '?' is deprecated.

Agreed.

-- PMM

      reply	other threads:[~2012-08-02  9:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-01 16:13 [Qemu-devel] [PATCH v2] Support 'help' as a synonym for '?' in command line options Peter Maydell
2012-08-02  9:03 ` Markus Armbruster
2012-08-02  9:10   ` Peter Maydell [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=CAFEAcA9138s55ChpeUEbacfFwv5JCG_p4z_MwYEyJmfLFzrLuA@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=aliguori@us.ibm.com \
    --cc=armbru@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=eblake@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=patches@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).