2019-06-28 16:05:04 +04:00
|
|
|
open Trace
|
2019-09-20 13:59:44 +04:00
|
|
|
open Main.Display
|
2019-06-28 16:05:04 +04:00
|
|
|
|
2019-09-20 13:59:44 +04:00
|
|
|
let toplevel ~(display_format : string) (x : string result) =
|
|
|
|
let display_format =
|
|
|
|
try display_format_of_string display_format
|
|
|
|
with _ -> (
|
|
|
|
Format.printf "bad display format %s, try looking at DISPLAY_FORMAT in the man (--help)." display_format ;
|
|
|
|
failwith "Display format"
|
|
|
|
)
|
|
|
|
in
|
2019-09-04 20:41:14 +04:00
|
|
|
match x with
|
2019-09-26 15:01:09 +04:00
|
|
|
| Ok _ -> Format.printf "%a\n%!" (formatted_string_result_pp display_format) x
|
2019-09-04 20:41:14 +04:00
|
|
|
| Error _ ->
|
2019-09-26 15:01:09 +04:00
|
|
|
Format.eprintf "%a\n%!" (formatted_string_result_pp display_format) x ;
|
2019-09-04 20:41:14 +04:00
|
|
|
exit 1
|