package core

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
include sig ... end
type 'a param = 'a Command.Param.t
  • deprecated [since 2019-03] use [Command.Param.t] instead
val return : 'a -> 'a Command.Param.t
val map : 'a Command.Param.t -> f:('a -> 'b) -> 'b Command.Param.t
val both : 'a Command.Param.t -> 'b Command.Param.t -> ('a * 'b) Command.Param.t
val (<*>) : ('a -> 'b) Command.Param.t -> 'a Command.Param.t -> 'b Command.Param.t
val (<*) : 'a Command.Param.t -> unit Command.Param.t -> 'a Command.Param.t
val (*>) : unit Command.Param.t -> 'a Command.Param.t -> 'a Command.Param.t
val (>>|) : 'a Command.Param.t -> ('a -> 'b) -> 'b Command.Param.t
val apply : ('a -> 'b) Command.Param.t -> 'a Command.Param.t -> 'b Command.Param.t
val map2 : 'a Command.Param.t -> 'b Command.Param.t -> f:('a -> 'b -> 'c) -> 'c Command.Param.t
val map3 : 'a Command.Param.t -> 'b Command.Param.t -> 'c Command.Param.t -> f:('a -> 'b -> 'c -> 'd) -> 'd Command.Param.t
val all : 'a Command.Param.t list -> 'a list Command.Param.t
val all_unit : unit Command.Param.t list -> unit Command.Param.t
module Applicative_infix : sig ... end
val help : Base.string Base.Lazy.t Command.Param.t
val path : Base.string Base.list Command.Param.t
val args : Base.string Base.list Command.Param.t
val flag : ?aliases:Base.string Base.list -> ?full_flag_required:Base.unit -> Base.string -> 'a Command.Flag.t -> doc:Base.string -> 'a Command.Param.t
val flag_optional_with_default_doc : ?aliases:Base.string Base.list -> ?full_flag_required:Base.unit -> Base.string -> 'a Command.Arg_type.t -> ('a -> Base.Sexp.t) -> default:'a -> doc:Base.string -> 'a Command.Param.t
val anon : 'a Command.Anons.t -> 'a Command.Param.t
val escape_anon : final_anon:'a Command.Anons.t -> ('a * Base.string Base.list) Command.Param.t
module If_nothing_chosen : sig ... end
val choose_one : 'a Base.option Command.Param.t Base.list -> if_nothing_chosen:('a, 'b) If_nothing_chosen.t -> 'b Command.Param.t
val choose_one_non_optional : 'a Command.Param.t Base.list -> if_nothing_chosen:('a, 'b) If_nothing_chosen.t -> 'b Command.Param.t
val and_arg_names : 'a Command.Param.t -> ('a * Base.string Base.list) Command.Param.t
val and_arg_name : 'a Command.Param.t -> ('a * Base.string) Command.Param.t
val arg_names : 'a Command.Param.t -> Base.string Base.list
val const : 'a -> 'a Command.Param.t
  • deprecated [since 2018-10] use [Command.Param.return] instead of [Command.Spec.const]
val pair : 'a Command.Param.t -> 'b Command.Param.t -> ('a * 'b) Command.Param.t
  • deprecated [since 2018-10] use [Command.Param.both] instead of [Command.Spec.pair]
type ('main_in, 'main_out) t = ('main_in, 'main_out) Command.Spec.t
val empty : ('m, 'm) t
val (++) : ('m1, 'm2) t -> ('m2, 'm3) t -> ('m1, 'm3) t
val (+>) : ('m1, 'a -> 'm2) t -> 'a Command.Param.t -> ('m1, 'm2) t
val (+<) : ('m1, 'm2) t -> 'a Command.Param.t -> ('a -> 'm1, 'm2) t
val step : ('m1 -> 'm2) -> ('m1, 'm2) t
val wrap : (run:('m1 -> 'r1) -> main:'m2 -> 'r2) -> ('m1, 'r1) t -> ('m2, 'r2) t
type 'a flag = 'a Command.Flag.t
val required : 'a Command.Arg_type.t -> 'a flag
val optional : 'a Command.Arg_type.t -> 'a Base.option flag
val optional_with_default : 'a -> 'a Command.Arg_type.t -> 'a flag
val listed : 'a Command.Arg_type.t -> 'a Base.list flag
val one_or_more_as_pair : 'a Command.Arg_type.t -> ('a * 'a Base.list) flag
val one_or_more_as_list : 'a Command.Arg_type.t -> 'a Base.list flag
val no_arg : Base.bool flag
val no_arg_register : key:'a Univ_map.With_default.Key.t -> value:'a -> Base.bool flag
val no_arg_some : 'a -> 'a Base.option flag
val no_arg_required : 'a -> 'a flag
val no_arg_abort : exit:(Base.unit -> Base.Nothing.t) -> Base.unit flag
val escape : Base.string Base.list Base.option flag
val escape_with_autocomplete : complete:Command.Auto_complete.For_escape.t -> Base.string Base.list Base.option flag
val map_flag : 'a flag -> f:('a -> 'b) -> 'b flag
val flags_of_args_exn : (Stdlib.Arg.key * Stdlib.Arg.spec * Stdlib.Arg.doc) Base.list -> ('a, 'a) t
  • deprecated [since 2018-10] switch to Command.Param
type 'a anons = 'a Command.Anons.t
val (%:) : Base.string -> 'a Command.Arg_type.t -> 'a anons
val sequence : 'a anons -> 'a Base.list anons
val non_empty_sequence_as_pair : 'a anons -> ('a * 'a Base.list) anons
val non_empty_sequence_as_list : 'a anons -> 'a Base.list anons
val maybe : 'a anons -> 'a Base.option anons
val maybe_with_default : 'a -> 'a anons -> 'a anons
val t2 : 'a anons -> 'b anons -> ('a * 'b) anons
val t3 : 'a anons -> 'b anons -> 'c anons -> ('a * 'b * 'c) anons
val t4 : 'a anons -> 'b anons -> 'c anons -> 'd anons -> ('a * 'b * 'c * 'd) anons
val map_anons : 'a anons -> f:('a -> 'b) -> 'b anons
val to_param : ('a, 'r) t -> 'a -> 'r Command.Param.t
val of_param : 'r Command.Param.t -> ('r -> 'm, 'm) t
module Arg_type = Arg_type
include module type of struct include Arg_type.Export end

Values to include in other namespaces.

Values to include in other namespaces.

val string : Base.string Command.Spec.Arg_type.t
val int : Base.int Command.Spec.Arg_type.t

Beware that an anonymous argument of type int cannot be specified as negative, as it is ambiguous whether -1 is a negative number or a flag. (The same applies to float, time_span, etc.) You can use the special built-in "-anon" flag to force a string starting with a hyphen to be interpreted as an anonymous argument rather than as a flag, or you can just make it a parameter to a flag to avoid the issue.

val char : Base.char Command.Spec.Arg_type.t
val float : Base.float Command.Spec.Arg_type.t
val bool : Base.bool Command.Spec.Arg_type.t
val sexp : Base.Sexp.t Command.Spec.Arg_type.t
val sexp_conv : ?complete:Command.Auto_complete.t -> (Base.Sexp.t -> 'a) -> 'a Command.Spec.Arg_type.t
OCaml

Innovation. Community. Security.