(** Parsing command-line options *)
(** The type [command] denotes some possible behaviours of the
compiler.
*)
type command = Quiet | Copy | Units | Tokens
(** The type [options] gathers the command-line options.
*)
type options = <
input : string option;
libs : string list;
verbose : Utils.String.Set.t;
offsets : bool;
mode : [`Byte | `Point];
cmd : command;
mono : bool
>
let make ~input ~libs ~verbose ~offsets ~mode ~cmd ~mono =
object
method input = input
method libs = libs
method verbose = verbose
method offsets = offsets
method mode = mode
method cmd = cmd
method mono = mono
end
(** {1 Auxiliary functions} *)
let printf = Printf.printf
let sprintf = Printf.sprintf
let print = print_endline
let abort msg =
Utils.highlight (sprintf "Command-line error: %s\n" msg); exit 1
(** {1 Help} *)
let help language extension () =
let file = Filename.basename Sys.argv.(0) in
printf "Usage: %s [