package ez_cmdliner

  1. Overview
  2. Docs

Parameters

module M : sig ... end

Signature

val main : ?on_error:(unit -> unit) -> ?on_exit:(unit -> unit) -> ?print_config:(unit -> unit) -> ?common_args:(string list * spec * TYPES.info) list -> ?argv:string array -> TYPES.sub list -> unit

main ?on_error ?print_config ?common_args ?argv subcommands parse arguments and execute corresponding subcommands.

  • subcommands: multi-level subcommands. Multiple keywords are separated by spaces within the subcommand name.
  • ?on_error: function called when an exception is raised.
  • ?on_exit: function called on exit when no exception is raised.
  • ?print_config: function called when no sub-command is provided.
  • ?common_args: additional common arguments (common to all subcommands). -v|--verbose|-q|--quiet are always included.
  • ?argv: list of arguments used instead of Sys.argv.
OCaml

Innovation. Community. Security.