ligo/src/bin/cli_helpers.ml

13 lines
408 B
OCaml
Raw Normal View History

open Trace
2019-09-20 13:59:44 +04:00
open Main.Display
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
Format.printf "%a" (formatted_string_result_pp display_format) x