val basic :
?readme:(unit -> string) ->
('main, unit -> unit) Spec.t -> 'main -> t
basic ~summary ?readme spec mainis a basic command that executes a function
mainwhich is passed parameters parsed from the command line according to
summaryis to contain a short one-line description of its behavior.
readmeis to contain any longer description of its behavior that will go on that commands' help screen.
val group :
?readme:(unit -> string) -> (string * t) list -> t
group ~summary subcommand_alistis a compound command with named subcommands, as found in
summaryis to contain a short one-line description of the command group.
readmeis to contain any longer description of its behavior that will go on that command's help screen.
NOTE: subcommand names containing underscores will be rejected. Use dashes instead.
val run :
?argv:string list ->
?extend:(string list -> string list) -> t -> unit
argvif it is specified.
extend can be used to add extra command line arguments to basic subcommands of the
extend will be passed the (fully expanded) path to a command, and its
output will be appended to the list of arguments being processed. For example,
suppose a program like this is compiled into
let bar = Command.basic ... let foo = Command.group ~summary:... ["bar", bar] let main = Command.group ~summary:... ["foo", foo] Command.run ~extend:(fun _ -> ["-baz"]) main
Then if a user ran
exe f b,
extend would be passed
["foo"; "bar"] and
would be appended to the command line for processing by
bar. This can be used to
add a default flags section to a user config file.
Deprecatedshould be used only by