sig
exception Invalid_arguments of string list
module Flag :
sig
type 'a t = 'a Deprecated_command.Flag.t
val name : 'a t -> string
type ('a, 'b) create =
string ->
?aliases:string list ->
?full_flag_required:bool -> 'b -> doc:string -> 'a t
val of_arg : Core.Std.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_string : (unit, string ref) create
val set_string_opt : (unit, string option ref) create
val set_int : (unit, int ref) create
val set_int_opt : (unit, int option ref) create
val set_float : (unit, float ref) create
val set_float_opt : (unit, float option ref) create
val set_date : (unit, Core.Std.Date.t ref) create
val set_date_opt : (unit, Core.Std.Date.t option ref) create
val set : (unit, bool ref) create
val clear : (unit, bool ref) create
val set_gen : (string -> 'gen) -> (unit, 'gen ref) create
val set_gen_opt : (string -> 'gen) -> (unit, 'gen option 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.Std.Date.t -> 'a) create
val rest_acc : ('a, 'a -> string list -> 'a) create
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.Std.Date.t -> unit) create
val rest_mut : ('a, 'a -> string list -> unit) create
val gen_mut : (string -> 'gen) -> ('a, 'a -> 'gen -> unit) create
module Action :
sig
type 'accum t = 'accum Deprecated_command.Flag.Action.t
val noarg : ('accum -> unit) -> 'accum t
val arg : ('accum -> string -> unit) -> 'accum t
val rest : ('accum -> string list -> unit) -> 'accum t
val int : ('accum -> int -> unit) -> 'accum t
val bool : ('accum -> bool -> unit) -> 'accum t
val float : ('accum -> float -> unit) -> 'accum t
end
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
val lift_unit : unit t -> 'any t
val to_spec :
('accum -> 'accum) ref ->
'accum t -> ('c, 'c) Core.Std.Command.Spec.t
val to_spec_unit : unit t -> ('c, 'c) Core.Std.Command.Spec.t
val to_spec_units : unit t list -> ('c, 'c) Core.Std.Command.Spec.t
end
module Shared_flags :
sig
type 'a t =
'a Deprecated_command.Shared_flags.t = {
flags : unit Flag.t list;
get : unit -> 'a;
}
end
type t = Deprecated_command.t
module Autocomplete :
sig
type t = string list -> string list
module Bash_action :
sig
type t =
[ `Alias
| `Arrayvar
| `Binding
| `Builtin
| `Command
| `Directory
| `Disabled
| `Enabled
| `Export
| `File
| `Function
| `Group
| `Helptopic
| `Hostname
| `Job
| `Keyword
| `Running
| `Service
| `Setopt
| `Shopt
| `Signal
| `Stopped
| `User
| `Variable ]
end
val bash : Bash_action.t list -> t
end
val create :
?autocomplete:Autocomplete.t ->
?readme:(unit -> string) ->
summary:string ->
usage_arg:string ->
init:(unit -> 'accum) ->
flags:'accum Flag.t list ->
final:('accum -> string list -> 'argv) -> ('argv -> unit) -> t
val create0 :
?autocomplete:Autocomplete.t ->
?readme:(unit -> string) ->
summary:string ->
usage_arg:string ->
init:(unit -> 'accum) ->
flags:'accum Flag.t list ->
final:('accum -> 'args) -> ('args -> unit) -> t
val create_no_accum :
?autocomplete:Autocomplete.t ->
?readme:(unit -> string) ->
summary:string ->
usage_arg:string ->
flags:unit Flag.t list ->
final:(string list -> 'args) -> ('args -> unit) -> t
val create_no_accum0 :
?autocomplete:Autocomplete.t ->
?readme:(unit -> string) ->
summary:string ->
usage_arg:string -> flags:unit Flag.t list -> (unit -> unit) -> t
val group :
summary:string -> ?readme:(unit -> string) -> (string * t) list -> t
type 'a with_run_flags =
?version:string ->
?build_info:string ->
?argv:string list ->
?allow_unknown_flags:bool ->
?allow_underscores:bool ->
?hash_bang_expand:bool ->
?post_parse:([ `Error | `Help | `Ok ] -> string list -> unit) ->
t -> 'a
val run : unit with_run_flags
val get_expanded_argv : unit -> string list
val get_expanded_cmdline : unit -> string
module Version :
sig
val command : ?version:string -> ?build_info:string -> unit -> t
val print_version : ?version:string -> unit -> unit
end
module Annotated_field :
sig
type t = Deprecated_command.Annotated_field.t
type accum = Deprecated_command.Annotated_field.accum
val required :
?name:string ->
t list -> doc:string -> ('a, 'b) Fieldslib.Field.t -> t list
val default :
?name:string ->
'field ->
('field -> string) ->
t list -> doc:string -> ('a, 'field) Fieldslib.Field.t -> t list
val optional :
?name:string ->
?suppress_word_optional:bool ->
t list -> doc:string -> ('a, 'b option) Fieldslib.Field.t -> t list
val set :
?name:string ->
t list -> doc:string -> ('a, bool) Fieldslib.Field.t -> t list
val clear :
?name:string ->
t list -> doc:string -> ('a, bool) Fieldslib.Field.t -> t list
val list :
?name:string ->
t list -> doc:string -> ('a, 'b list) Fieldslib.Field.t -> t list
val init : t list -> accum
val to_flag : t -> accum Flag.t
val get :
accum ->
(string -> 'field) -> ('a, 'field) Fieldslib.Field.t -> 'field
val get_opt :
accum ->
(string -> 'field) ->
('a, 'field option) Fieldslib.Field.t -> 'field option
val get_list :
accum ->
(string -> 'field) ->
('a, 'field list) Fieldslib.Field.t -> 'field list
end
module Flags_ext :
sig
type 'a setter =
'a Deprecated_command.Flags_ext.setter =
No_arg of 'a
| Arg of (string -> 'a)
type ('a, 'flag) t = ('a, 'flag) Deprecated_command.Flags_ext.t
val flag : ('a, 'flag) t -> 'flag
val get : ('a, 'b) t -> 'a
val is_set : ('a, 'b) t -> bool
val create_optional :
name:string -> doc:string -> 'a setter -> ('a option, unit Flag.t) t
val create :
?default:'a * ('a -> string) ->
name:string -> doc:string -> 'a setter -> ('a, unit Flag.t) t
val create_many :
?at_least_one:bool ->
name:string -> doc:string -> 'a setter -> ('a list, unit Flag.t) t
val create_choice :
?default:'a * ('a -> string) ->
(string * string * 'a setter) list -> ('a, unit Flag.t list) t
val create_choice_optional :
(string * string * 'a setter) list -> ('a option, unit Flag.t list) t
val create_set : name:string -> doc:string -> (bool, unit Flag.t) t
val create_rest :
?name:string ->
doc:string -> unit -> (string list option, unit Flag.t) t
end
module Helpers :
sig
exception Found_anonymous_arguments
val no_anons : 'a -> string list -> 'a
end
val of_core_command : Core.Std.Command.t -> t
end