Err_cli
Err_cli contains functions to work with Err on the side of end programs (such as a command line tool, as opposed to libraries).
It defines a command line parser to configure the Err
library, while taking take of setting the Logs
and Fmt
style rendering.
module Config : sig ... end
val setup_config : config:Config.t -> unit
Perform global side effects to modules such as Err
, Logs
& Fmt
to configure how to do error rendering in the terminal, set log levels, etc. If you wish to do this automatically from the arguments parsed in a command line, see also set_config
.
val set_config : unit -> unit Cmdlang.Command.Arg.t
Adding this argument to your command line will make it support Err
configuration and takes care of setting the global configuration with specification coming from the command line. This is designed to work well with project using Err
, Logs
and Fmt
.
let open Command.Std in
let+ () = Err_cli.set_config () in ...