Library
Module
Module type
Parameter
Class
Class type
Configuration and runtime command-line arguments.
module Arg : sig ... end
Cross-stage command-line arguments.
The type for configuration keys. Keys are used to retrieve the cross-stage values they are holding (by indexing contents in the autogenerated Bootgen_var
module) but also to parameterize the choice of module implementation.
create n a
is the key named n
whose contents is determined by parsing the command-line argument a
.
The type for configure-time and run-time values. Values are either pure
or obtained by composing other values. Values might have data dependencies, which form an (implicit) directed and acyclic graph that need to be evaluated.
val pure : 'a -> 'a value
pure x
is a value without any dependency.
f $ v
is is the value resulting from the application of f
'value to v
's value. $
is the usual app operator for applicative functor.
val default : 'a value -> 'a
default v
returns the default value for v
.
The type for abstract keys.
val name : t -> string
name t
is the string given as t
's name when t
was created.
val hash : t -> int
hash
is the hash function for untyped keys.
module Set : sig ... end
Set
implements sets over t
elements.
val is_runtime : t -> bool
is_runtime k
is true if k
's stage is `Run
or `Both
.
val is_configure : t -> bool
is_configure k
is true if k
's stage is `Configure
or `Both
.
filter_stage s ks
is ks
but with only keys available at stage s
.
module Alias : sig ... end
Alias allows to define virtual keys in terms of other keys at configuration time only.
val empty_context : context
val context :
?stage:Arg.stage ->
with_required:bool ->
Set.t ->
context Cmdliner.Term.t
context ~with_required ks
is a Cmdliner
term that evaluates into a parsing context for command-line arguments. If with_required
is false, it will only produce optional keys.
mem c v
is true
iff all the dependencies of v
have been evaluated.
eval c v
evaluates v
in c
's context, using default values if necessary.
get c k
is k
's value in c
's context. If k
is not present in c
, it is k
's default value.
find c k
is k
's value in c
's context or None
if k
is not present in c
.
pps c fmt ks
prints the keys ks
using the context c
to get their value.
val ocaml_name : t -> string
ocaml_name k
is the ocaml name of k
.
serialize_call fmt k
outputs Key_gen.n ()
to fmt
, where n
is k
's OCaml name.