X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=virt-top%2Fvirt_top_main.ml;h=4ab60ada291f0584f2a4552bda8998be8a23dba5;hb=bb0788a39d9b8675db60a61ecd2baebfdfb5ca10;hp=edf87de3b540a868b08a7fbd4bd85e31820f2e63;hpb=9bb5f67c0d8a6e8dad7de72e2488ee73c90f7d43;p=virt-top.git diff --git a/virt-top/virt_top_main.ml b/virt-top/virt_top_main.ml index edf87de..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; - 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 () =