From: Richard Jones Date: Mon, 5 Oct 2009 16:55:32 +0000 (+0100) Subject: Add virt-top --version command line option. X-Git-Tag: 1.0.5~42 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=7ee2450a998f6efb6e5a75dfae8aabcc43b110ac;p=virt-top.git Add virt-top --version command line option. --- diff --git a/virt-top/virt_top.ml b/virt-top/virt_top.ml index 3ad7afc..90ceec2 100644 --- a/virt-top/virt_top.ml +++ b/virt-top/virt_top.ml @@ -157,6 +157,10 @@ let start_up () = and no_init_file () = init_file := NoInitFile and set_init_file filename = init_file := InitFile filename and set_end_time time = end_time := Some ((!parse_date_time) time) + and display_version () = + printf "virt-top %s ocaml-libvirt %s\n" + Virt_top_version.version Libvirt_version.version; + exit 0 in let argspec = Arg.align [ "-1", Arg.Unit set_pcpu_mode, @@ -199,6 +203,8 @@ let start_up () = " " ^ s_ "Secure (\"kiosk\") mode"; "--script", Arg.Set script_mode, " " ^ s_ "Run from a script (no user interface)"; + "--version", Arg.Unit display_version, + " " ^ s_ "Display version number and exit"; ] in let anon_fun str = raise (Arg.Bad (sprintf (f_ "%s: unknown parameter") str)) in