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 :; (*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 -> -> 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 init : unit -> unit
val freeze : unit -> unit
Don't register builtin plugin past this point.
val register_builtin : t -> unit
Register a builtin subcommand. This can only be done by builtin plugin and before freezing.
val register_plugin : t -> unit
Register a plugin subcommand. Synopsis is overriden by the plugin_synopsis * present in findlib if there is some defined.
val find : -> t
Find a subcommand.
val list_plugin : unit -> PluginLoader.entry list
List all PluginLoader entries registered.
val list_builtin : unit -> t list
List all builtin plugin registered.