Module Core__.Command
include module type of Core_kernel.Command with module Command.Shape := Core__.Import.Command.Shape with module Deprecated := Core__.Import.Command.Deprecated
- module Arg_type : sig ... end
- Argument types. 
- module Flag : sig ... end
- Command-line flag specifications. 
- module Anons : sig ... end
- Anonymous command-line argument specification. 
- module Param : sig ... end
- Command-line parameter specification. 
module Let_syntax : sig ... end with type 'a t := 'a Param.t- module Spec : sig ... end
- The old interface for command-line specifications -- Do Not Use. 
- type ('main, 'result) basic_spec_command- = summary:Core_kernel__.Import.string -> ?readme:(Core_kernel__.Import.unit -> Core_kernel__.Import.string) -> ('main, Core_kernel__.Import.unit -> 'result) Spec.t -> 'main -> t
- val basic_spec : ('main, Core_kernel__.Import.unit) basic_spec_command
- basic_spec ~summary ?readme spec mainis a basic command that executes a function- mainwhich is passed parameters parsed from the command line according to- spec.- 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 command's help screen.
- type 'result basic_command- = summary:Core_kernel__.Import.string -> ?readme:(Core_kernel__.Import.unit -> Core_kernel__.Import.string) -> (Core_kernel__.Import.unit -> 'result) Param.t -> t
- val basic : Core_kernel__.Import.unit basic_command
- Same general behavior as - basic_spec, but takes a command line specification built up using- Paramsinstead of- Spec.
- val group : summary:Core_kernel__.Import.string -> ?readme:(Core_kernel__.Import.unit -> Core_kernel__.Import.string) -> ?preserve_subcommand_order:Core_kernel__.Import.unit -> ?body:(path:Core_kernel__.Import.string Core_kernel__.Import.list -> Core_kernel__.Import.unit) -> (Core_kernel__.Import.string * t) Core_kernel__.Import.list -> t
- group ~summary subcommand_alistis a compound command with named subcommands, as found in- subcommand_alist.- 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. - bodyis called when no additional arguments are passed -- in particular, when no subcommand is passed. Its- pathargument is the subcommand path by which the group command was reached.
- val lazy_group : summary:Core_kernel__.Import.string -> ?readme:(Core_kernel__.Import.unit -> Core_kernel__.Import.string) -> ?preserve_subcommand_order:Core_kernel__.Import.unit -> ?body:(path:Core_kernel__.Import.string Core_kernel__.Import.list -> Core_kernel__.Import.unit) -> (Core_kernel__.Import.string * t) Core_kernel__.Import.list Core_kernel.Lazy.t -> t
- lazy_groupis the same as- group, except that the list of subcommands may be generated lazily.
- val exec : summary:Core_kernel__.Import.string -> ?readme:(Core_kernel__.Import.unit -> Core_kernel__.Import.string) -> ?child_subcommand:Core_kernel__.Import.string Core_kernel__.Import.list -> path_to_exe:[ `Absolute of Core_kernel__.Import.string | `Relative_to_argv0 of Core_kernel__.Import.string | `Relative_to_me of Core_kernel__.Import.string ] -> Core_kernel__.Import.unit -> t
- exec ~summary ~path_to_exeruns- execon the executable at- path_to_exe. If- path_to_exeis- `Absolute paththen- pathis executed without any further qualification. If it is- `Relative_to_me paththen- Filename.dirname Sys.executable_name ^ "/" ^ pathis executed instead. All of the usual caveats about- Sys.executable_nameapply: specifically, it may only return an absolute path in Linux. On other operating systems it will return- Sys.argv.(0). If it is- `Relative_to_argv0 paththen- Sys.argv.(0) ^ "/" ^ pathis executed.- The - child_subcommandargument allows referencing a subcommand one or more levels below the top-level of the child executable. It should not be used to pass flags or anonymous arguments to the child.- Care has been taken to support nesting multiple executables built with Command. In particular, recursive help and autocompletion should work as expected. - NOTE: Non-Command executables can be used with this function but will still be executed when - help -recursiveis called or autocompletion is attempted (despite the fact that neither will be particularly helpful in this case). This means that if you have a shell script called "reboot-everything.sh" that takes no arguments and reboots everything no matter how it is called, you shouldn't use it with- exec.- Additionally, no loop detection is attempted, so if you nest an executable within itself, - help -recursiveand autocompletion will hang forever (although actually running the subcommand will work).
- val of_lazy : t Core_kernel.Lazy.t -> t
- of_lazy thunkconstructs a lazy command that is forced only when necessary to run it or extract its shape.
- val summary : t -> Core_kernel__.Import.string
- Extracts the summary string for a command. 
module Shape : sig ... end- module Deprecated : sig ... end
- Deprecatedshould be used only by- Deprecated_command. At some point it will go away.
- val run : ?verbose_on_parse_error:bool -> ?version:string -> ?build_info:string -> ?argv:string list -> ?extend:(string list -> string list) -> t -> unit
- Runs a command against - Sys.argv, or- argvif it is specified.- extendcan be used to add extra command line arguments to basic subcommands of the command.- extendwill 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- exe:- 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,- extendwould be passed- ["foo"; "bar"]and- "-baz"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.- verbose_on_parse_errorcontrols whether to print a line suggesting the user try the "-help" flag when an exception is raised while parsing the arguments. By default it is true.
module Path : sig ... endmodule Shape : sig ... end- module Deprecated : sig ... end
- Deprecatedshould be used only by- Deprecated_command. At some point it will go away.