Module Cli

Cmdliner and common definitions for commands.

Converters and options

val path_arg : Fpath.t Cmdliner.Arg.conv

path_arg is a path argument converter.

val pkg_file : Fpath.t Cmdliner.Term.t

A --pkg-file option to specify the package description file to use.

val pkg_name : string option Cmdliner.Term.t

A --pkg-name option to specify the opam package name.

val dist_name : string option Cmdliner.Term.t

A --dist-name option to define the package name of the distribution.

val dist_version : string option Cmdliner.Term.t

A --dist-version option to define the package version.

val dist_file : Fpath.t option Cmdliner.Term.t

A --dist-file option to define the distribution archive file.

val dist_uri : string option Cmdliner.Term.t

A --dist-uri option to define the distribution archive URI on the WWW.

val dist_opam : Fpath.t option Cmdliner.Term.t

An --dist-opam option to define the opam file.

val readme : Fpath.t option Cmdliner.Term.t

A --readme option to define the readme.

val change_log : Fpath.t option Cmdliner.Term.t

A --change-log option to define the change log.

val opam : Fpath.t option Cmdliner.Term.t

An --opam option to define an opam file.

val delegate : Bos.Cmd.t option Cmdliner.Term.t

A --delegate option to define the delegate.

val build_dir : Fpath.t option Cmdliner.Term.t

A --build-dir option to define the build directory.

val publish_msg : string option Cmdliner.Term.t

A --msg option to define a publication message.

Terms

val setup : unit Cmdliner.Term.t

setup env defines a basic setup common to all commands. The setup does, by side effect, set Logs log verbosity, adjusts colored output and sets the current working directory.

Verbosity propagation

val propagate_verbosity_to_pkg_file : unit -> Bos.Cmd.t

propagate_verbosity_to_pkg_file () is a command line fragment that has the option to propagate the current log verbosity to an invocation of the package description.

Warnings and errors

val warn_if_vcs_dirty : string -> (unit, Rresult.R.msg) Rresult.result

warn_if_vcs_dirty msg warns with msg if the VCS is dirty.

val handle_error : (int, Rresult.R.msg) Rresult.result -> int

handle_error r is r's result or logs r's error and returns 3.

val exits : Cmdliner.Term.exit_info list

exits is are the exit codes common to all commands.