Note:

You are viewing a development version of the library. Goto the latest version.

Module SubCommand


module SubCommand: sig .. end
SubCommand definition
Author(s): Sylvain Le Gall


type t = {
   scmd_name : OASISTypes.name; (*Name of the subcommand, used to call it*)
   scmd_synopsis : string; (*Short description of the subcommnad, displayed when doing a summary of the available subcommands*)
   scmd_help : string; (*Long description of the subcommand, displayed when showing help of the subcommand.

It can contains variable substitution as defined in Buffer.add_substitute.

*)
   scmd_specs : (Arg.key * Arg.spec * Arg.doc) list; (*Arg spec list*)
   scmd_usage : string; (*Arg usage text*)
   scmd_anon : string -> unit; (*Arg anon function*)
   scmd_main : unit -> unit; (*Real action of the subcommand*)
}
val make : ?std_usage:bool ->
OASISTypes.name -> string -> string -> (unit -> unit) -> t
make ~std_usage name synopsis help main Create a subcommand using provided data, see SubCommand.t for their meanings. If ~std_usage is set use "[options*]" for it. Fields that are not defined by make use a sane default.
val register : t -> unit
Register a subcommand.
val fold : (t -> 'a -> 'a) -> 'a -> 'a
Iterate through subcommands.
val find : OASISTypes.name -> t
Find a subcommand.