@@ -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);
}
Only print options in the help output that are accepted by our arch. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> --- vl.c | 31 +++++++++++++++++-------------- 1 files changed, 17 insertions(+), 14 deletions(-)