package climate

  1. Overview
  2. Docs

Module Arg_parser.CompletionSource

Sourcetype 'a parser := 'a t
Sourcetype 'a t
Sourcetype command_line = {
  1. program : string;
  2. subcommand : string list;
  3. args : string list;
}
Sourceval file : _ t

Complete using paths relative to the current directory. This can be used with convs of any type though care must be taken that the conv knows how to parse paths. This requirement isn't enforced with types as it would be too restrictive to be useful in general.

Sourceval values : 'a list -> 'a t
Sourceval reentrant : (command_line -> 'a list) -> 'a t
Sourceval reentrant_parse : 'a list parser -> 'a t
Sourceval reentrant_thunk : (unit -> 'a list) -> 'a t
Sourceval some : 'a t -> 'a option t

For use in cases the optionality of a value being parsed/completed needs to represented in the value itself.

Sourceval stringify : 'a t -> 'a print -> _ t

Flatten the completion information into plain strings. This can be used to supply completion hints that otherwise wouldn't satisfy the type constraints within a conv, though care must be taken to ensure that the conv knows how to parse the suggestions as this will no longer be enforced by the type system when this function is used.

OCaml

Innovation. Community. Security.