sig
module Spec :
sig
type 'a param
val const : 'a -> 'a Command.Spec.param
val map :
'a Command.Spec.param -> f:('a -> 'b) -> 'b Command.Spec.param
val help : string Core_kernel.Std.Lazy.t Command.Spec.param
val path : string list Command.Spec.param
val args : string list Command.Spec.param
type ('main_in, 'main_out) t
val empty : ('m, 'm) Command.Spec.t
val ( ++ ) :
('m1, 'm2) Command.Spec.t ->
('m2, 'm3) Command.Spec.t -> ('m1, 'm3) Command.Spec.t
val ( +> ) :
('m1, 'a -> 'm2) Command.Spec.t ->
'a Command.Spec.param -> ('m1, 'm2) Command.Spec.t
val ( +< ) :
('m1, 'm2) Command.Spec.t ->
'a Command.Spec.param -> ('a -> 'm1, 'm2) Command.Spec.t
val step : ('m1 -> 'm2) -> ('m1, 'm2) Command.Spec.t
val wrap :
(run:('m1 -> 'r1) -> main:'m2 -> 'r2) ->
('m1, 'r1) Command.Spec.t -> ('m2, 'r2) Command.Spec.t
module Arg_type :
sig
type 'a t
val create :
?complete:(Core_kernel.Std.Univ_map.t ->
part:string -> string list) ->
?key:'a Core_kernel.Std.Univ_map.Multi.Key.t ->
(string -> 'a) -> 'a Command.Spec.Arg_type.t
val of_map :
?key:'a Core_kernel.Std.Univ_map.Multi.Key.t ->
'a Core_kernel.Std.String.Map.t -> 'a Command.Spec.Arg_type.t
val of_alist_exn :
?key:'a Core_kernel.Std.Univ_map.Multi.Key.t ->
(string * 'a) list -> 'a Command.Spec.Arg_type.t
end
val string : string Command.Spec.Arg_type.t
val int : int Command.Spec.Arg_type.t
val float : float Command.Spec.Arg_type.t
val bool : bool Command.Spec.Arg_type.t
val date : Date.t Command.Spec.Arg_type.t
val time_span : Span.t Command.Spec.Arg_type.t
val file : string Command.Spec.Arg_type.t
type 'a flag
val flag :
?aliases:string list ->
string -> 'a Command.Spec.flag -> doc:string -> 'a Command.Spec.param
val required : 'a Command.Spec.Arg_type.t -> 'a Command.Spec.flag
val optional :
'a Command.Spec.Arg_type.t -> 'a option Command.Spec.flag
val optional_with_default :
'a -> 'a Command.Spec.Arg_type.t -> 'a Command.Spec.flag
val listed : 'a Command.Spec.Arg_type.t -> 'a list Command.Spec.flag
val no_arg : bool Command.Spec.flag
val no_arg_register :
key:'a Core_kernel.Std.Univ_map.With_default.Key.t ->
value:'a -> bool Command.Spec.flag
val no_arg_abort :
exit:(unit -> Core_kernel.Std.never_returns) ->
unit Command.Spec.flag
val escape : string list option Command.Spec.flag
val flags_of_args_exn :
Core_kernel.Std.Arg.t list -> ('a, 'a) Command.Spec.t
type 'a anons
val anon : 'a Command.Spec.anons -> 'a Command.Spec.param
val ( %: ) :
string -> 'a Command.Spec.Arg_type.t -> 'a Command.Spec.anons
val sequence : 'a Command.Spec.anons -> 'a list Command.Spec.anons
val maybe : 'a Command.Spec.anons -> 'a option Command.Spec.anons
val maybe_with_default :
'a -> 'a Command.Spec.anons -> 'a Command.Spec.anons
val t2 :
'a Command.Spec.anons ->
'b Command.Spec.anons -> ('a * 'b) Command.Spec.anons
val t3 :
'a Command.Spec.anons ->
'b Command.Spec.anons ->
'c Command.Spec.anons -> ('a * 'b * 'c) Command.Spec.anons
val t4 :
'a Command.Spec.anons ->
'b Command.Spec.anons ->
'c Command.Spec.anons ->
'd Command.Spec.anons -> ('a * 'b * 'c * 'd) Command.Spec.anons
end
type t
val basic :
summary:string ->
?readme:(unit -> string) ->
('main, unit -> unit) Command.Spec.t -> 'main -> Command.t
val group :
summary:string ->
?readme:(unit -> string) -> (string * Command.t) list -> Command.t
val run :
?version:string ->
?build_info:string ->
?argv:string list ->
?extend:(string list -> string list) -> Command.t -> unit
module Deprecated :
sig
module Spec :
sig
val no_arg : hook:(unit -> unit) -> bool Command.Spec.flag
val escape :
hook:(string list -> unit) ->
string list option Command.Spec.flag
val ad_hoc : usage_arg:string -> string list Command.Spec.anons
end
val summary : Command.t -> string
val help_recursive :
cmd:string ->
with_flags:bool ->
expand_dots:bool -> Command.t -> string -> (string * string) list
val run :
Command.t ->
cmd:string ->
args:string list ->
is_help:bool ->
is_help_rec:bool ->
is_help_rec_flags:bool -> is_expand_dots:bool -> unit
val get_flag_names : Command.t -> string list
val version : string
val build_info : string
end
end