Commit 9bd7e6d90d2cc6e3ca20fd9819550af7b6e9cbe1
1 parent
37f9ba46
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
Showing
2 changed files
with
18 additions
and
2 deletions
qemu-options.hx
... | ... | @@ -17,6 +17,13 @@ STEXI |
17 | 17 | Display help and exit |
18 | 18 | ETEXI |
19 | 19 | |
20 | +DEF("version", 0, QEMU_OPTION_version, | |
21 | + "-version display version information and exit\n") | |
22 | +STEXI | |
23 | +@item -version | |
24 | +Display version information and exit | |
25 | +ETEXI | |
26 | + | |
20 | 27 | DEF("M", HAS_ARG, QEMU_OPTION_M, |
21 | 28 | "-M machine select emulated machine (-M ? for list)\n") |
22 | 29 | STEXI | ... | ... |
vl.c
... | ... | @@ -3940,10 +3940,15 @@ static int main_loop(void) |
3940 | 3940 | return ret; |
3941 | 3941 | } |
3942 | 3942 | |
3943 | +static void version(void) | |
3944 | +{ | |
3945 | + printf("QEMU PC emulator version " QEMU_VERSION ", Copyright (c) 2003-2008 Fabrice Bellard\n"); | |
3946 | +} | |
3947 | + | |
3943 | 3948 | static void help(int exitcode) |
3944 | 3949 | { |
3945 | - printf("QEMU PC emulator version " QEMU_VERSION ", Copyright (c) 2003-2008 Fabrice Bellard\n" | |
3946 | - "usage: %s [options] [disk_image]\n" | |
3950 | + version(); | |
3951 | + printf("usage: %s [options] [disk_image]\n" | |
3947 | 3952 | "\n" |
3948 | 3953 | "'disk_image' is a raw hard image image for IDE hard disk 0\n" |
3949 | 3954 | "\n" |
... | ... | @@ -4598,6 +4603,10 @@ int main(int argc, char **argv, char **envp) |
4598 | 4603 | case QEMU_OPTION_h: |
4599 | 4604 | help(0); |
4600 | 4605 | break; |
4606 | + case QEMU_OPTION_version: | |
4607 | + version(); | |
4608 | + exit(0); | |
4609 | + break; | |
4601 | 4610 | case QEMU_OPTION_m: { |
4602 | 4611 | uint64_t value; |
4603 | 4612 | char *ptr; | ... | ... |