Module Core_extended__Deprecated_command.Flag

type 'a t

type of flags to a command with accumulator type 'a

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
Flag handling without an accumulator
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_string : (unit, string Core.refcreate
val set_string_opt : (unit, string option Core.refcreate
val set_int : (unit, int Core.refcreate
val set_int_opt : (unit, int option Core.refcreate
val set_float : (unit, float Core.refcreate
val set_float_opt : (unit, float option Core.refcreate
val set_date : (unit, Core.Date.t Core.refcreate
val set_date_opt : (unit, Core.Date.t option Core.refcreate
val set : (unit, bool Core.refcreate
val clear : (unit, bool Core.refcreate
val set_gen : (string ‑> 'gen) ‑> (unit, 'gen Core.refcreate
val set_gen_opt : (string ‑> 'gen) ‑> (unit, 'gen option Core.refcreate
flag handling meant for use with immutable accumulator
val noarg_acc : ('a'a ‑> 'acreate
val string_acc : ('a'a ‑> string ‑> 'acreate
val int_acc : ('a'a ‑> int ‑> 'acreate
val bool_acc : ('a'a ‑> bool ‑> 'acreate
val float_acc : ('a'a ‑> float ‑> 'acreate
val date_acc : ('a'a ‑> Core.Date.t ‑> 'acreate

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 ‑> 'acreate

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 ‑> 'acreate
flag handling meant for use with mutable accumulator
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
module Action : sig ... end

Deprecated

val create : ?aliases:string list ‑> ?full_flag_required:bool ‑> name:string ‑> doc:string ‑> 'a Action.t ‑> 'a t
val lift : 'a t ‑> project:('b ‑> 'a * ('a ‑> 'b)) ‑> 'b t

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 lift_unit : unit t ‑> 'any t
val to_spec : ('accum ‑> 'accum) Core.ref ‑> 'accum t ‑> ('c'cCore.Command.Spec.t
val to_spec_unit : unit t ‑> ('c'cCore.Command.Spec.t
val to_spec_units : unit t list ‑> ('c'cCore.Command.Spec.t