From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Michael Ellerman Date: Mon, 12 Dec 2011 19:21:44 +1100 Message-Id: <1323678104-30133-3-git-send-email-michael@ellerman.id.au> 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> Subject: [Qemu-devel] [PATCH 3/3] In qemu -h output, only print options for the arch we are running as List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Michael Ellerman 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); } -- 1.7.7.3