From patchwork Thu Aug 9 21:02:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 176275 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9ED7A2C0094 for ; Fri, 10 Aug 2012 07:02:33 +1000 (EST) Received: from localhost ([::1]:39725 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzZsF-0007qP-P3 for incoming@patchwork.ozlabs.org; Thu, 09 Aug 2012 17:02:31 -0400 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) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=k8+SHym2j+NOo9acVmMt7VoGkvpSOK5TrxDLUa8plIM=; b=K/us9xr07RfQcNvYvdHelpvO0JH6VKwBI28SWJHq/rCg+raRKr/KV+Rpeml5JuNY8P 3VuPrqL/NFGri90KBI1doXpO3vyS7L2efeM9qQ5sniEpNva0IqrO9Bb0hodk+3iB2BRY 4NF9OO0LrXFOOmDtLTRlBRkpKe3FfJ4aZVoMgbhFUl+6wa+MkQ2tpf6VKjT9n0OOdJGN 61iGMMRO3N648iQcYlYIxz5g27LzZsCLG3SyRmKLxOO+5fykUE7eDo1/TpBSjc6Q8iBZ 8/DfrcXBVaB3Gto4JPQpCp4C6WBgrZjZCNTXa3B86DJnVGO3MEqqmjl/0qXcuo7P1w6h Tm5Q== MIME-Version: 1.0 Received: by 10.50.106.136 with SMTP id gu8mr2578073igb.23.1344546142460; Thu, 09 Aug 2012 14:02:22 -0700 (PDT) Received: by 10.50.3.9 with HTTP; Thu, 9 Aug 2012 14:02:22 -0700 (PDT) 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 To: Eduardo Habkost X-Gm-Message-State: ALoCoQnOn3H4U5Y33717osIMfLX9uU9rXYr2uvOx81tSVZ7D7VrnH77vArPe+F3HM2sU9sdTgGrJ X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.161.173 Cc: Anthony Liguori , patches@linaro.org, Michael Tokarev , Markus Armbruster , qemu-devel@nongnu.org, Blue Swirl , Eric Blake Subject: Re: [Qemu-devel] [PATCH v3] Support 'help' as a synonym for '?' in command line options X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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: (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 --- 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); }