X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;ds=sidebyside;f=virt-top%2Fvirt_top_main.ml;h=4ab60ada291f0584f2a4552bda8998be8a23dba5;hb=4ded35791664acbb8b1b83abd2e2df899d92bdd8;hp=cb3486ee5152729629335ccf14a0161ee4632807;hpb=757832f0f789d30abcad040216bd8a69e25842d5;p=virt-top.git diff --git a/virt-top/virt_top_main.ml b/virt-top/virt_top_main.ml index cb3486e..4ab60ad 100644 --- a/virt-top/virt_top_main.ml +++ b/virt-top/virt_top_main.ml @@ -21,6 +21,7 @@ open Curses +open Virt_top_gettext.Gettext open Virt_top (* Note: make sure we catch any exceptions and clean up the display. @@ -30,20 +31,20 @@ open Virt_top * the program under --debug ...). *) let error = - let setup = start_up () in + let ((_, _, script_mode, _, _, _, _) as setup) = start_up () in try main_loop setup; - if !script_mode then endwin (); + if not script_mode then endwin (); false with | Libvirt.Virterror err -> - endwin (); + if not script_mode then endwin (); prerr_endline (Libvirt.Virterror.to_string err); true | exn -> - endwin (); - prerr_endline ("Error: " ^ Printexc.to_string exn); + if not script_mode then endwin (); + prerr_endline (s_ "Error" ^ ": " ^ Printexc.to_string exn); true let () =