From 7ee2450a998f6efb6e5a75dfae8aabcc43b110ac Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Mon, 5 Oct 2009 17:55:32 +0100 Subject: [PATCH] Add virt-top --version command line option. --- virt-top/virt_top.ml | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 1.8.3.1