(* Parsing command-line options *)
(* The type [options] gathers the command-line options. *)
type language = PascaLIGO | CameLIGO | ReasonLIGO
module SSet = Set.Make (String)
type options = <
input : string;
libs : string list;
lang : language;
offsets : bool;
verbose : SSet.t
>
let make ~input ~libs ~lang ~offsets ~verbose =
object
method input = input
method libs = libs
method lang = lang
method offsets = offsets
method verbose = verbose
end
(* Auxiliary functions and modules *)
let printf = Printf.printf
let sprintf = Printf.sprintf
let print = print_endline
(* Printing a string in red to standard error *)
let highlight msg = Printf.eprintf "\027[31m%s\027[0m%!" msg
(* Failure *)
let abort msg =
highlight (sprintf "Command-line error: %s\n" msg); exit 1
(* Help *)
let help () =
let file = Filename.basename Sys.argv.(0) in
printf "Usage: %s [