Arg_completeCommand line argument specifications are extended with completion functions.
Type for function providing multiple-argument completions (only in Rest_all).
type spec = | Unit of unit -> unitCall the function with unit argument
*)| Bool of bool -> unitCall the function with a bool argument
*)| Set of bool Stdlib.refSet the reference to true
*)| Clear of bool Stdlib.refSet the reference to false
*)| String of string -> unit * completeCall the function with a string argument
*)| Set_string of string Stdlib.ref * completeSet the reference to the string argument
*)| Int of int -> unit * completeCall the function with an int argument
*)| Set_int of int Stdlib.ref * completeSet the reference to the int argument
*)| Float of float -> unit * completeCall the function with a float argument
*)| Set_float of float Stdlib.ref * completeSet the reference to the float argument
*)| Tuple of spec listTake several arguments according to the spec list
*)| Symbol of string list * string -> unitTake one of the symbols as argument and call the function with the symbol
*)| Rest of string -> unit * completeStop interpreting keywords and call the function with each remaining argument
*)| Rest_all of string list -> unit * complete_allStop interpreting keywords and call the function with all remaining arguments
*)| Expand of string -> string arrayIf the remaining arguments to process are of the form ["-foo"; "arg"] @ rest where "foo" is registered as Expand f, then the arguments f "arg" @ rest are processed. Only allowed in Stdlib.Arg.parse_and_expand_argv_dynamic.
Command line argument specification like Stdlib.Arg.spec, but extended with completion functions.
module Rest_all_compat : sig ... endCompatibility for Rest_all before OCaml 4.12
type speclist = (Stdlib.Arg.key * spec * Stdlib.Arg.doc) listThe library does not provide parsing of command line arguments itself. Instead, the following functions can be used to strip completion functions from specifications, such that parsing functions from Stdlib.Arg can be used.
val arg_speclist : speclist -> arg_speclistStrip completion functions from speclist.
type anon_complete = completeval complete_argv :
?prefer_getopt_long:bool ->
string list ->
speclist ->
anon_complete ->
string listcomplete_argv args speclist anon_complete provides the completions for the partial arguments args using speclist for options and anon_complete for anonymous arguments.
val empty : completeCompletion function with constant empty result.
val empty_all : complete_allCompletion function with constant empty result for Rest_all.
val strings : string list -> completeCompletion function for a list of possible strings.
module Util : sig ... end