Implement --version.
Signed-off-by: Paul Brook <paul@codesourcery.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7035 c046a42c-6fe2-441c-8c8c-71466251a162
diff --git a/vl.c b/vl.c
index 4bd173f..e444f9c 100644
--- a/vl.c
+++ b/vl.c
@@ -3940,10 +3940,15 @@
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 @@
case QEMU_OPTION_h:
help(0);
break;
+ case QEMU_OPTION_version:
+ version();
+ exit(0);
+ break;
case QEMU_OPTION_m: {
uint64_t value;
char *ptr;