Module Cmdliner_term

Terms

type term_escape = [
| `Error of bool * string
| `Help of Cmdliner_manpage.format * string option
]
type 'a parser = Cmdliner_info.Eval.t -> Cmdliner_cline.t -> ('a[ `Parse of string | term_escape ]) Stdlib.result

Type type for command line parser. given static information about the command line and a command line to parse returns an OCaml value.

type 'a t = Cmdliner_info.Arg.Set.t * 'a parser

The type for terms. The list of arguments it can parse and the parsing function that does so.

val const : 'a -> 'a t
val app : ('a -> 'b) t -> 'a t -> 'b t
val ($) : ('a -> 'b) t -> 'a t -> 'b t
type 'a ret = [
| `Ok of 'a
| term_escape
]
val ret : 'a ret t -> 'a t
val term_result : ?usage:bool -> ('a[ `Msg of string ]) Stdlib.result t -> 'a t
val term_result' : ?usage:bool -> ('a, string) Stdlib.result t -> 'a t
val cli_parse_result : ('a[ `Msg of string ]) Stdlib.result t -> 'a t
val cli_parse_result' : ('a, string) Stdlib.result t -> 'a t
val main_name : string t
val choice_names : string list t
val with_used_args : 'a t -> ('a * string list) t