From c07f0633cd38ec1d90b6c46624764f6447b77d9a Mon Sep 17 00:00:00 2001 From: Tom Jack Date: Wed, 4 Sep 2019 09:41:14 -0700 Subject: [PATCH] Print errors to stderr, exit 1 --- src/bin/cli_helpers.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bin/cli_helpers.ml b/src/bin/cli_helpers.ml index dacac127e..ee757ffba 100644 --- a/src/bin/cli_helpers.ml +++ b/src/bin/cli_helpers.ml @@ -9,4 +9,8 @@ let toplevel ~(display_format : string) (x : string result) = failwith "Display format" ) in - Format.printf "%a" (formatted_string_result_pp display_format) x + match x with + | Ok _ -> Format.printf "%a" (formatted_string_result_pp display_format) x + | Error _ -> + Format.eprintf "%a" (formatted_string_result_pp display_format) x ; + exit 1