From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwrQ2-0001pT-M1 for qemu-devel@nongnu.org; Thu, 02 Aug 2012 05:10:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwrPy-00081x-3h for qemu-devel@nongnu.org; Thu, 02 Aug 2012 05:10:10 -0400 Received: from mail-yx0-f173.google.com ([209.85.213.173]:38947) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwrPy-0007zf-05 for qemu-devel@nongnu.org; Thu, 02 Aug 2012 05:10:06 -0400 Received: by yenl1 with SMTP id l1so8201119yen.4 for ; Thu, 02 Aug 2012 02:10:05 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <87mx2dy8c0.fsf@blackfin.pond.sub.org> References: <1343837599-9597-1-git-send-email-peter.maydell@linaro.org> <87mx2dy8c0.fsf@blackfin.pond.sub.org> Date: Thu, 2 Aug 2012 10:10:04 +0100 Message-ID: From: Peter Maydell Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v2] Support 'help' as a synonym for '?' in command line options List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Anthony Liguori , patches@linaro.org, Michael Tokarev , qemu-devel@nongnu.org, Blue Swirl , Eric Blake On 2 August 2012 10:03, Markus Armbruster 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