package b0

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module B0_cliSource

Command line interface fragments and logic.

Converters

Sourceval 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.

Predefined

output_details is an invocation of B0_std_cli.output_details.

log_format is an invocation of B0_memo_cli.Log.format.

memo_op_query is an invocation of B0_memo_cli.Op.query_cli.

Sourceval no_pager : bool Cmdliner.Term.t

no_pager is an invocation of B0_pager.don't.

Specifying units and packs

Sourceval get_excluded_units : x_units:string list -> x_packs:string list -> (B0_unit.Set.t, string) 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".

Sourceval use_units : ?docs:string -> ?doc:string -> unit -> string list Cmdliner.Term.t

units defines unit names with -u and --unit.

Sourceval use_x_units : ?docs:string -> ?doc:string -> unit -> string list Cmdliner.Term.t

x_units defines unit names to exclude with -x and --x-unit.

Sourceval use_packs : ?docs:string -> ?doc:string -> unit -> string list Cmdliner.Term.t

packs defines pack names with -p and --pack.

Sourceval use_x_packs : ?docs:string -> ?doc:string -> unit -> string list Cmdliner.Term.t

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.

Sourceval build_units : string list Cmdliner.Term.t

units is use_units.

Sourceval build_x_units : string list Cmdliner.Term.t

units is use_x_units.

Sourceval build_packs : string list Cmdliner.Term.t

build_packs is use_packs.

Sourceval build_x_packs : string list Cmdliner.Term.t

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".

Sourceval act_on_units_posn : ?doc:string -> first:int -> unit -> string list Cmdliner.Term.t

act_on_units_posn ~first () defines units to act on at position first.

Sourceval act_on_units_pos0 : string list Cmdliner.Term.t

act_on_units_pos0 is act_on_units ~first:0 ().

Sourceval act_on_units_pos1 : string list Cmdliner.Term.t

act_on_units_pos1 is act_on_units ~first:1 ().

Sourceval act_on_packs_posn : ?doc:string -> first:int -> unit -> string list Cmdliner.Term.t

act_on_packs_posn ~first () defines packs to act on at position first.

Sourceval act_on_packs_pos0 : string list Cmdliner.Term.t

act_on_packs_pos0 is act_on_packs ~first:0 ().

Sourceval act_on_packs_pos1 : string list Cmdliner.Term.t

act_on_packs_pos1 is act_on_packs ~first:1 ().

Metadata keys

Sourceval required_metadata_key_pos0 : string Cmdliner.Term.t

B0 directory

Structured access to _b0 currently lives in B0_build.B0_dir.

Sourceval 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).

Sourceval 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).

Sourceval 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.

Sourceval 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.

b0_dir_env is "B0_DIR".

Sourceval b0_dirname : string

b0_dir_name is "_b0" the default b0 directory name.