Configuration converters
type 'a parser = string -> ('a, [ `Msg of string ]) Stdlib.resultThe type for configuration converter parsers.
type 'a printer = 'a Fmt.tThe type for configuration converter printers.
Keys
key ~docs ~docv ~doc name conv default is a configuration key named name that maps to value default by default. conv is used to convert key values provided by end users.
docs is the title of a documentation section under which the key is documented. doc is a short documentation string for the key, this should be a single sentence or paragraph starting with a capital letter and ending with a dot. docv is a meta-variable for representing the values of the key (e.g. "BOOL" for a boolean).
- raises Invalid_argument
if the key name is not made of a sequence of ASCII lowercase letter, digit, dash or underscore.
Warning. No two keys should share the same
nameas this may lead to difficulties in the UI.
val name : 'a key -> stringThe key name.
val default : 'a key -> 'adefault k is k's default value.
val doc : 'a key -> string optiondoc k is k's documentation string (if any).
val docv : 'a key -> string optiondocv k is k's value documentation meta-variable (if any).
val docs : 'a key -> string optiondocs k is k's documentation section (if any).
val root : string option keyDefault --root=ROOT argument.
Configurations
val empty : tempty is the empty configuration.
val is_empty : t -> boolis_empty c is true iff c is empty.
Built-in value converters
val bool : bool converterbool converts values with bool_of_string.
val int : int converterint converts values with int_of_string.
val string : string converterstring converts values with the identity function.
uri converts values with Uri.of_string.