diff --git a/qemu-options.hx b/qemu-options.hx index c40ea1efca7c74d9cc96c2204126a2e6ec835e5d..f551775152c20257b75f8de23b03d6f5e832112a 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -17,6 +17,13 @@ STEXI Display help and exit ETEXI +DEF("version", 0, QEMU_OPTION_version, + "-version display version information and exit\n") +STEXI +@item -version +Display version information and exit +ETEXI + DEF("M", HAS_ARG, QEMU_OPTION_M, "-M machine select emulated machine (-M ? for list)\n") STEXI diff --git a/vl.c b/vl.c index 4bd173f689b883a46d34a50788679bc92d696ee3..e444f9c2c649758ee07b0bcc276fa3f803ec16f6 100644 --- a/vl.c +++ b/vl.c @@ -3940,10 +3940,15 @@ static int main_loop(void) return ret; } +static void version(void) +{ + printf("QEMU PC emulator version " QEMU_VERSION ", Copyright (c) 2003-2008 Fabrice Bellard\n"); +} + static void help(int exitcode) { - printf("QEMU PC emulator version " QEMU_VERSION ", Copyright (c) 2003-2008 Fabrice Bellard\n" - "usage: %s [options] [disk_image]\n" + version(); + printf("usage: %s [options] [disk_image]\n" "\n" "'disk_image' is a raw hard image image for IDE hard disk 0\n" "\n" @@ -4598,6 +4603,10 @@ int main(int argc, char **argv, char **envp) case QEMU_OPTION_h: help(0); break; + case QEMU_OPTION_version: + version(); + exit(0); + break; case QEMU_OPTION_m: { uint64_t value; char *ptr;