`sig
module Opt :
sig
exception No_value
exception Option_error of string * string
exception Option_help
type 'a t = {
option_set : string -> string list -> unit;
option_set_value : 'a -> unit;
option_get : unit -> 'a option;
option_metavars : string list;
option_defhelp : string option;
}
val get : 'a BatOptParse.Opt.t -> 'a
val set : 'a BatOptParse.Opt.t -> 'a -> unit
val opt : 'a BatOptParse.Opt.t -> 'a option
val is_set : 'a BatOptParse.Opt.t -> bool
val value_option :
string ->
'a option ->
(string -> 'a) -> (exn -> string -> string) -> 'a BatOptParse.Opt.t
val callback_option :
string ->
(string -> 'a) ->
(exn -> string -> string) -> ('a -> unit) -> unit BatOptParse.Opt.t
end
module StdOpt :
sig
val store_const : ?default:'a -> 'a -> 'a BatOptParse.Opt.t
val store_true : unit -> bool BatOptParse.Opt.t
val store_false : unit -> bool BatOptParse.Opt.t
val count_option :
?dest:int Pervasives.ref ->
?increment:int -> unit -> int BatOptParse.Opt.t
val incr_option :
?dest:int Pervasives.ref -> unit -> int BatOptParse.Opt.t
val decr_option :
?dest:int Pervasives.ref -> unit -> int BatOptParse.Opt.t
val int_option :
?default:int -> ?metavar:string -> unit -> int BatOptParse.Opt.t
val float_option :
?default:float -> ?metavar:string -> unit -> float BatOptParse.Opt.t
val str_option :
?default:string ->
?metavar:string -> unit -> string BatOptParse.Opt.t
val any_option :
?default:'a option ->
?metavar:string -> (string -> 'a) -> 'a BatOptParse.Opt.t
val int_callback :
?metavar:string -> (int -> unit) -> unit BatOptParse.Opt.t
val float_callback :
?metavar:string -> (float -> unit) -> unit BatOptParse.Opt.t
val str_callback :
?metavar:string -> (string -> unit) -> unit BatOptParse.Opt.t
val help_option : unit -> 'a BatOptParse.Opt.t
val version_option : (unit -> string) -> 'a BatOptParse.Opt.t
end
module Formatter :
sig
type t = {
indent : unit -> unit;
dedent : unit -> unit;
format_usage : string -> string;
format_heading : string -> string;
format_description : string -> string;
format_option :
char list * string list -> string list -> string option -> string;
}
val indented_formatter :
?level:int Pervasives.ref ->
?indent:int Pervasives.ref ->
?indent_increment:int ->
?max_help_position:int ->
?width:int -> ?short_first:bool -> unit -> BatOptParse.Formatter.t
val titled_formatter :
?level:int Pervasives.ref ->
?indent:int Pervasives.ref ->
?indent_increment:int ->
?max_help_position:int ->
?width:int -> ?short_first:bool -> unit -> BatOptParse.Formatter.t
val wrap :
?initial_indent:int ->
?subsequent_indent:int -> string -> int -> string list
val fill :
?initial_indent:int ->
?subsequent_indent:int -> string -> int -> string
end
module OptParser :
sig
exception Option_conflict of string
type t
type group
val make :
?usage:string ->
?description:string ->
?version:string ->
?suppress_usage:bool ->
?suppress_help:bool ->
?only_leading_opts:bool ->
?prog:string ->
?formatter:BatOptParse.Formatter.t -> unit -> BatOptParse.OptParser.t
val add :
BatOptParse.OptParser.t ->
?group:BatOptParse.OptParser.group ->
?help:string ->
?hide:bool ->
?short_name:char ->
?short_names:char list ->
?long_name:string ->
?long_names:string list -> 'a BatOptParse.Opt.t -> unit
val add_group :
BatOptParse.OptParser.t ->
?parent:BatOptParse.OptParser.group ->
?description:string -> string -> BatOptParse.OptParser.group
val error :
BatOptParse.OptParser.t ->
?chn:Pervasives.out_channel -> ?status:int -> string -> unit
val usage :
BatOptParse.OptParser.t ->
?chn:Pervasives.out_channel -> unit -> unit
val parse :
BatOptParse.OptParser.t ->
?first:int -> ?last:int -> string array -> string list
val parse_argv : BatOptParse.OptParser.t -> string list
end
end`