ligo/src/bin/cli_helpers.ml

11 lines
349 B
OCaml
Raw Normal View History

open Cmdliner
open Trace
2019-09-20 13:59:44 +04:00
open Main.Display
let toplevel ~(display_format : display_format) (x : string result) : unit Term.ret =
2019-09-04 20:41:14 +04:00
match x with
| Ok _ -> Format.printf "%a%!" (formatted_string_result_pp display_format) x;
`Ok ()
2019-09-04 20:41:14 +04:00
| Error _ ->
`Error (false, Format.asprintf "%a%!" (formatted_string_result_pp display_format) x)