From patchwork Mon Dec 12 08:21:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 130668 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C6AEDB70BB for ; Mon, 12 Dec 2011 19:22:13 +1100 (EST) Received: from localhost ([::1]:35255 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ra19D-0007L8-1n for incoming@patchwork.ozlabs.org; Mon, 12 Dec 2011 03:22:07 -0500 Received: from eggs.gnu.org ([140.186.70.92]:33996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ra195-0007Jx-Qu for qemu-devel@nongnu.org; Mon, 12 Dec 2011 03:22:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ra190-00039n-7T for qemu-devel@nongnu.org; Mon, 12 Dec 2011 03:21:59 -0500 Received: from ozlabs.org ([203.10.76.45]:43891) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ra18z-00039X-Ma for qemu-devel@nongnu.org; Mon, 12 Dec 2011 03:21:54 -0500 Received: by ozlabs.org (Postfix, from userid 1034) id 8832DB70BB; Mon, 12 Dec 2011 19:21:52 +1100 (EST) From: Michael Ellerman To: qemu-devel@nongnu.org Date: Mon, 12 Dec 2011 19:21:44 +1100 Message-Id: <1323678104-30133-3-git-send-email-michael@ellerman.id.au> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1323678104-30133-1-git-send-email-michael@ellerman.id.au> References: <1323677680.3070.43.camel@concordia> <1323678104-30133-1-git-send-email-michael@ellerman.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 203.10.76.45 Cc: Michael Ellerman Subject: [Qemu-devel] [PATCH 3/3] In qemu -h output, only print options for the arch we are running as 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 Only print options in the help output that are accepted by our arch. Signed-off-by: Michael Ellerman --- vl.c | 31 +++++++++++++++++-------------- 1 files changed, 17 insertions(+), 14 deletions(-) diff --git a/vl.c b/vl.c index b492f8c..ba8e76d 100644 --- a/vl.c +++ b/vl.c @@ -1492,28 +1492,31 @@ static void version(void) static void help(int exitcode) { - const char *options_help = -#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \ - opt_help -#define DEFHEADING(text, arch_mask) stringify(text) "\n" + version(); + printf("usage: qemu [options] [disk_image]\n" + "\n" + "'disk_image' is a raw hard disk image for IDE hard disk 0\n\n"); + +#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \ + if ((arch_mask) & arch_type) \ + fputs(opt_help, stdout); + +#define DEFHEADING(text, arch_mask) \ + if ((arch_mask) & arch_type) \ + puts(stringify(text)); + #include "qemu-options.def" #undef DEF #undef DEFHEADING #undef GEN_DOCS - ; - version(); - printf("usage: qemu [options] [disk_image]\n" - "\n" - "'disk_image' is a raw hard disk image for IDE hard disk 0\n" - "\n" - "%s\n" - "During emulation, the following keys are useful:\n" + + printf("\nDuring emulation, the following keys are useful:\n" "ctrl-alt-f toggle full screen\n" "ctrl-alt-n switch to virtual console 'n'\n" "ctrl-alt toggle mouse and keyboard grab\n" "\n" - "When using -nographic, press 'ctrl-a h' to get some help.\n", - options_help); + "When using -nographic, press 'ctrl-a h' to get some help.\n"); + exit(exitcode); }