Arg.Conv
Argument converters.
An argument converter transforms a string argument of the command line to an OCaml value. Predefined converters are provided for many types of the standard library.
type 'a parser = string -> ('a, string) result
The type for parsing arguments to values of type 'a
.
type 'a fmt = Stdlib.Format.formatter -> 'a -> unit
The type for formatting values of type 'a
.
val make :
?completion:'a Completion.t ->
docv:string ->
parser:'a parser ->
pp:'a fmt ->
unit ->
'a t
make ~docv ~parser ~pp ()
is an argument converter with given properties. See corresponding accessors for semantics.
val of_conv :
?completion:'a Completion.t ->
?docv:string ->
?parser:'a parser ->
?pp:'a fmt ->
'a t ->
'a t
of_conv conv ()
is a new converter with given unspecified properties defaulting to those of conv
.
val docv : 'a t -> string
docv c
is c
's documentation meta-variable. This value can be refered to as $(docv)
in the documentation strings of arguments. It can be overriden by the info
value of an argument.
val completion : 'a t -> 'a Completion.t
completion c
is c
's completion.