package core

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Spec.Arg_typeSource

Argument types.

Sourcetype 'a t = 'a Arg_type.t

The type of a command line argument.

Sourceval create : ?complete:Auto_complete.t -> ?key:'a Univ_map.Multi.Key.t -> (Base.String.t -> 'a) -> 'a t

An argument type includes information about how to parse values of that type from the command line, and (optionally) how to autocomplete partial arguments of that type via bash's programmable tab-completion.

If the of_string function raises an exception, command line parsing will be aborted and the exception propagated up to top-level and printed along with command-line help.

Sourceval map : ?key:'b Univ_map.Multi.Key.t -> 'a t -> f:('a -> 'b) -> 'b t

Transforms the result of a t using f.

Sourceval of_lazy : ?key:'a Univ_map.Multi.Key.t -> 'a t Lazy.t -> 'a t

Defers construction of the arg type until it is needed.

Sourceval of_map : ?accept_unique_prefixes:Base.Bool.t -> ?case_sensitive:Base.Bool.t -> ?list_values_in_help:Base.Bool.t -> ?auto_complete:Auto_complete.t -> ?key:'a Univ_map.Multi.Key.t -> 'a String.Map.t -> 'a t

An auto-completing Arg_type over a finite set of values.

Sourceval of_alist_exn : ?accept_unique_prefixes:Base.Bool.t -> ?case_sensitive:Base.Bool.t -> ?list_values_in_help:Base.Bool.t -> ?auto_complete:Auto_complete.t -> ?key:'a Univ_map.Multi.Key.t -> (Base.String.t * 'a) Base.List.t -> 'a t

Convenience wrapper for of_map. Raises on duplicate keys.

Sourceval enumerated : ?accept_unique_prefixes:Base.Bool.t -> ?case_sensitive:Base.Bool.t -> ?list_values_in_help:Base.Bool.t -> ?auto_complete:Auto_complete.t -> ?key:'a Univ_map.Multi.Key.t -> (module Enumerable_stringable with type t = 'a) -> 'a t

Convenience wrapper for of_alist_exn to use with ppx_enumerate using to_string. Raises on duplicate to_stringed values.

Sourceval enumerated_sexpable : ?accept_unique_prefixes:Base.Bool.t -> ?case_sensitive:Base.Bool.t -> ?list_values_in_help:Base.Bool.t -> ?auto_complete:Auto_complete.t -> ?key:'a Univ_map.Multi.Key.t -> (module Enumerable_sexpable with type t = 'a) -> 'a t

Convenience wrapper for of_alist_exn to use with ppx_enumerate using sexp_of_t to turn the value into a string. Raises on duplicate to_stringed values.

Sourceval comma_separated : ?allow_empty:Base.Bool.t -> ?key:'a Base.List.t Univ_map.Multi.Key.t -> ?strip_whitespace:Base.Bool.t -> ?unique_values:Base.Bool.t -> 'a t -> 'a Base.List.t t

comma_separated t accepts comma-separated lists of arguments parsed by t.

If strip_whitespace = true, whitespace is stripped from each comma-separated string before it is parsed by t.

If allow_empty = true then the empty string (or just whitespace, if strip_whitespace = true) results in an empty list, and if allow_empty = false then the empty string will fail to parse. (Note that there is currently no way for comma_separated to produce a list whose only element is the empty string.)

If unique_values = true no autocompletion will be offered for arguments already supplied in the fragment to complete.

Sourcemodule Export : sig ... end

Values to include in other namespaces.

Sourcemodule For_testing : sig ... end
OCaml

Innovation. Community. Security.