val name : _ t ‑> string
type ('a, 'b) create
= string ‑> ?aliases:string list ‑> ?full_flag_required:bool ‑> 'b ‑> doc:string ‑> 'a t
Template for flag-creation functions
val of_arg : Core.Arg.t ‑> unit t
val noarg : (unit, unit ‑> unit) create
val string : (unit, string ‑> unit) create
val int : (unit, int ‑> unit) create
val float : (unit, float ‑> unit) create
val bool : (unit, bool ‑> unit) create
val gen : (string ‑> 'gen) ‑> (unit, 'gen ‑> unit) create
val set_date : (unit, Core.Date.t Core.ref) create
val set_date_opt : (unit, Core.Date.t option Core.ref) create
val noarg_acc : ('a, 'a ‑> 'a) create
val string_acc : ('a, 'a ‑> string ‑> 'a) create
val int_acc : ('a, 'a ‑> int ‑> 'a) create
val bool_acc : ('a, 'a ‑> bool ‑> 'a) create
val float_acc : ('a, 'a ‑> float ‑> 'a) create
val date_acc : ('a, 'a ‑> Core.Date.t ‑> 'a) create
rest f
: a flag that signals the end of flag processing. all remaining arguments
are passed to the f
val rest_acc : ('a, 'a ‑> string list ‑> 'a) create
rest f
: a flag that signals the end of flag processing. all remaining arguments
are passed to the f
val gen_acc : (string ‑> 'gen) ‑> ('a, 'a ‑> 'gen ‑> 'a) create
val noarg_mut : ('a, 'a ‑> unit) create
val arg_mut : ('a, 'a ‑> string ‑> unit) create
val string_mut : ('a, 'a ‑> string ‑> unit) create
val int_mut : ('a, 'a ‑> int ‑> unit) create
val bool_mut : ('a, 'a ‑> bool ‑> unit) create
val float_mut : ('a, 'a ‑> float ‑> unit) create
val date_mut : ('a, 'a ‑> Core.Date.t ‑> unit) create
rest f
: a flag that signals the end of flag processing. all remaining arguments
are passed to the f
val rest_mut : ('a, 'a ‑> string list ‑> unit) create
rest f
: a flag that signals the end of flag processing. all remaining arguments
are passed to the f
val gen_mut : (string ‑> 'gen) ‑> ('a, 'a ‑> 'gen ‑> unit) create
lift t ~project
transforms a flag with accumulator type 'a
into a flag with a more informative accumulator type 'b
provided that project x
returns a pair consisting of
1. a 'a
-value extracted from the 'b
-value x
, and
2. a function for rebuilding a modified 'b
-value from
the modified 'a
-value resulting from processing the flag.
The intended use pattern for lift
is when 'b
is a record type
with a field foo
of type 'a
and project
is
fun r -> (r.foo, (fun foo' -> { r with foo = foo' }))
val to_spec : ('accum ‑> 'accum) Core.ref ‑> 'accum t ‑> ('c, 'c) Core.Command.Spec.t
val to_spec_unit : unit t ‑> ('c, 'c) Core.Command.Spec.t
val to_spec_units : unit t list ‑> ('c, 'c) Core.Command.Spec.t