Print errors (Failure exceptions) nicely.
authorRichard W.M. Jones <rjones@redhat.com>
Mon, 23 Dec 2019 20:42:11 +0000 (20:42 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Mon, 23 Dec 2019 20:42:11 +0000 (20:42 +0000)
src/main.ml

index b95d1f5..73a53da 100644 (file)
@@ -97,4 +97,7 @@ let main () =
   (* Evaluate the target expressions in turn. *)
   Eval.evaluate_targets env targets
 
-let () = main ()
+let () =
+  try main ()
+  with
+    Failure msg -> prerr_endline msg; exit 1