B0_cli
Command line interface fragments and logic.
val def_conv : (module B0_def.S) -> string Cmdliner.Arg.Conv.t
def_conv d
is a converter for definitions of type d
which knows how to complete them.
val output_details : B0_std_cli.output_details Cmdliner.Term.t
output_details
is an invocation of B0_std_cli.output_details
.
val log_format : B0_memo_cli.Log.format Cmdliner.Term.t
log_format
is an invocation of B0_memo_cli.Log.format
.
val memo_op_query : B0_memo_cli.Op.query Cmdliner.Term.t
memo_op_query
is an invocation of B0_memo_cli.Op.query_cli
.
val get_excluded_units :
x_units:string list ->
x_packs:string list ->
(B0_unit.Set.t, string) Stdlib.result
get_excluded_units ~x_units ~x_packs
is the set of units excluded by the given unit and pack names.
The following use options and the default doc string is generic of the form "use unit".
units
defines unit names with -u
and --unit
.
x_units
defines unit names to exclude with -x
and --x-unit
.
packs
defines pack names with -p
and --pack
.
packs
defines pack names to exclude via -X
and --x-pack
.
The following uses the above functions but with a doc string that indicates that units and packs are selected for build.
units
is use_units
.
units
is use_x_units
.
build_packs
is use_packs
.
build_x_packs
is use_x_packs
.
The following ones are positional arguments. The doc string is generic of the form "unit to act on, all of them if unspecified".
act_on_units_posn ~first ()
defines units to act on at position first
.
act_on_packs_posn ~first ()
defines packs to act on at position first
.
Structured access to _b0
currently lives in B0_build.B0_dir
.
val get_b0_dir :
cwd:B0_std.Fpath.t ->
root:B0_std.Fpath.t ->
b0_dir:B0_std.Fpath.t option ->
B0_std.Fpath.t
get_b0_dir ~cwd ~root ~b0_dir
determines a b0 directory. If b0_dir
is Some d
then this is Fpath.(cwd // d)
. If None
then this is Fpath.(root / b0_dir_name)
.
val get_cache_dir :
cwd:B0_std.Fpath.t ->
b0_dir:B0_std.Fpath.t ->
cache_dir:B0_std.Fpath.t option ->
B0_std.Fpath.t
get_cache_dir ~cwd ~b0_dir ~cache_dir
determines a cache directory. If cache_dir
is Some d
then this is Fpath.(cwd // d)
. If None
then this is Fpath.(b0_dir / cache_dir)
.
val find_dir_with_b0_dir : start:B0_std.Fpath.t -> B0_std.Fpath.t option
find_dir_with_b0_dir ~start
finds the first directory starting with start
that has a b0_dir_name
directory. None
is returned if none could found or if start
is relative.
val b0_dir :
?opts:string list ->
?docs:string ->
?doc:string ->
?doc_none:string ->
?env:Cmdliner.Cmd.Env.info ->
unit ->
B0_std.Fpath.t option Cmdliner.Term.t
b0_dir ~doc_none ~docs ~doc ~env
is a cli interface for specifying a b0 directory.
opts
are the cli options to specify it, defaults to ["b0-dir"]
.docs
is where the option is documented, defaults to Cmdliner.Manpage.s_common_options
doc
is a doc string.doc_none
describes how the value is determined if the term is evaluates to None
.env
is a variable that can be used to override the default value, defaults to b0_dir_env
.