Runtime support library for functoria-generated code

Runtime keys

type 'a t

The type for runtime keys containing a value of type 'a.

val create : 'a Arg.t -> 'a t

create conv create a new runtime key.

val get : 'a t -> 'a

get k is the value of the key k. Use the default value if no command-line argument is provided.

  • raises Invalid_argument

    if called before cmdliner's evaluation.

val default : 'a t -> 'a option

default k is the default value of k, if one is available. This function can be called before cmdliner's evaluation.

val term : 'a t -> unit Cmdliner.Term.t

term k is the Cmdliner term whose evaluation sets ks' value to the parsed command-line argument.