Module B0_driver.Cli

module Cli: sig .. end
Cmdliner support for drivers.

TODO What we put here we need to support in the long term so needs a good balancing act. Make the obvious desires easy to do (e.g. get a grip on the build outcome of the current variant).

Default dirs

val default_cache_dir : B0.Fpath.t
TODO get rid of this.

Exits and error handling

val exit_no_description : int
exit code when no description is found.
val exit_driver_setup_err : int
exit code when driver setup errors.
val exit_some_error : int
exit code when some undiscriminate error reported on stdout occurs.
val driver_default_exits : Cmdliner.Term.exit_info list
driver_default_exits describe the above errors to Cmdliner.
val handle_error : int B0.result -> int
handle_error (Ok c) is c. In case of error the message is logged on stderr and B0_driver.Cli.exit_some_error is returned.
val no_description_found : unit -> int
no_description_found () logs an error that no description was found and returns B0_driver.Cli.exit_no_description.

Argument converters

val path_arg : B0.Fpath.t Cmdliner.Arg.conv
path_arg is a cmdliner converter for Fpath values. This not not check for path existence, only that the path is valid.

Common arguments

val root : B0.Fpath.t option Cmdliner.Term.t
root specifies a root directory to lookup the description from.
val cwd : B0.Fpath.t option Cmdliner.Term.t
cwd specifies a directory to immedialy change to before interpreting anything in the program. In particular relative files on the cli should be interpreted according to this path.
val b0_dir : B0.Fpath.t option Cmdliner.Term.t
b0_dir specifies the b0 directory to use.
val color : B0.Tty.cap option Cmdliner.Term.t
color specifies the end-user output mode.
val verbosity : B0.Log.level option Cmdliner.Term.t
verbosity specifies the log verbosity.

More common arguments

val cache_dir : B0.Fpath.t option Cmdliner.Term.t
val cache_index : B0.Fpath.t option Cmdliner.Term.t
val variant_env : string
variant_env is the environment variable used to specify the default environment.
val variant : string option Cmdliner.Term.t
variant specifies the variant name to act upon.
val variant_scheme_env : string
val variant_scheme : string option Cmdliner.Term.t

Output format arguments

type out_fmt = [ `Long | `Normal | `Short ] 
The type for output format specification. Use to ask for less or more data.
val out_fmt : [ `Long | `Normal | `Short ] Cmdliner.Term.t
out_fmt specifies the amount of information requested.


val file_kind : [ `All | `Built | `Roots ] Cmdliner.Term.t
file_kind specifies the kind of files that need to be looked up.
val ctrl : B0.Build.ctrl Cmdliner.Term.t
ctrl has options control the build.

Driver setup arguments

Along with these arguments, these are automatically added to driver commands.

val s_driver_opts : string
val driver_dir : B0.Fpath.t option Cmdliner.Term.t
driver_dir is an option to specify the directory in which driver instances should be built.
val driver_only : bool Cmdliner.Term.t
driver_only is an option to specify that only the driver instance should be built and the program should stop.
val driver_force : bool Cmdliner.Term.t
driver_force is an option to specify that the driver instance should be recompiled unconditionaly.
val driver_trust : bool Cmdliner.Term.t
driver_trust is an option to specify that the driver instance should be trusted to be up-to-date.
val driver_ocamlc : string option Cmdliner.Term.t
driver_ocamlc is the executable to use as the OCaml byte-code compiler for the instance.
val driver_ocamlopt : string option Cmdliner.Term.t
driver_ocamlopt is the executable to use as the OCaml native-code compiler for the instance.
val driver_compile_kind : [ `Auto | `Byte | `Native ] option Cmdliner.Term.t
driver_compile_kind is an option to specify which kind of compilation should be used for compiling the instance.
val driver_compile : string list Cmdliner.Term.t
driver_compile are options to be added to the driver instance compilation command.
val driver_link : string list Cmdliner.Term.t
driver_link are options to be added to the driver link command.


val common_man : Cmdliner.Manpage.block
common_man is a manual that should be included in any driver command. It has the driver setup options in a dedicated section and a reference to the b0 manual.