Skip to content
Snippets Groups Projects
Commit 3cb2c5f4 authored by Michele Alberti's avatar Michele Alberti
Browse files

[cmdline] Use cmdliner converter for regular result type.

parent 6fb8aa76
No related branches found
No related tags found
No related merge requests found
...@@ -229,7 +229,7 @@ let verify_cmd = ...@@ -229,7 +229,7 @@ let verify_cmd =
let term = let term =
let files = let files =
let doc = "File to verify." in let doc = "File to verify." in
let file_or_stdin = Verification.File.(of_string, pretty) in let file_or_stdin = Arg.conv' Verification.File.(of_string, pretty) in
Arg.(non_empty & pos_all file_or_stdin [] & info [] ~doc ~docv:"FILE") Arg.(non_empty & pos_all file_or_stdin [] & info [] ~doc ~docv:"FILE")
in in
let prover = let prover =
......
...@@ -48,10 +48,10 @@ module File = struct ...@@ -48,10 +48,10 @@ module File = struct
let of_string s = let of_string s =
if String.equal s "-" if String.equal s "-"
then `Ok Stdin then Ok Stdin
else if Caml.Sys.file_exists s else if Caml.Sys.file_exists s
then `Ok (File s) then Ok (File s)
else `Error (Fmt.str "no '%s' file or directory" s) else Error (Fmt.str "no '%s' file or directory" s)
let pretty fmt = function let pretty fmt = function
| Stdin -> Fmt.string fmt "-" | Stdin -> Fmt.string fmt "-"
......
...@@ -38,7 +38,7 @@ module File : sig ...@@ -38,7 +38,7 @@ module File : sig
type t type t
val of_json_config : json_config -> t val of_json_config : json_config -> t
val of_string : string -> [ `Ok of t | `Error of string ] val of_string : string -> (t, string) result
val pretty : Format.formatter -> t -> unit val pretty : Format.formatter -> t -> unit
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment