Up

module Command_tree

: sig

Directory of command handlers (e.g. "store"; "add" -> Store.handle_add)

#
type command
#
type commands = (string * node) list
#
type node =
# | Command of command
# | Group of commands
#
type 'a handler = Options.global_settings -> ([<
| Options.zi_option
] as 'a) Support.Argparse.parsed_options -> string list -> unit

A handler for a command, accepting options of type 'a

#
val handle : command -> Options.global_settings -> Support.Argparse.raw_option list -> string list -> string list -> unit

Parse the options and run the appropriate handler.

#
val help : command -> string option

Get the help text for this command. None if this is a hidden (internal) command.

#
val options : command -> (Options.zi_option, Options.zi_arg_type) Support.Argparse.opt_spec list

Get the list of options supported by this command. For tab-completion.

#
val set_of_option_names : node -> Support.Common.StringSet.t

Return the supported option names as a set (for tab-completion).

#
val make_command : string -> 'a handler -> ('a, Options.zi_arg_type) Support.Argparse.opt_spec list -> node
#
val make_command_hidden : 'a handler -> ('a, Options.zi_arg_type) Support.Argparse.opt_spec list -> node
#
val make_group : commands -> node
#
val lookup : node -> string list -> string list * node * string list
end