package opam-client

  1. Overview
  2. Docs

CLI version helpers

type validity
val cli_from : ?platform:[ `all | `windows | `unix ] -> ?experimental:bool -> OpamCLIVersion.t -> validity
val cli_between : ?option:[ `experimental | `default ] -> OpamCLIVersion.t -> ?replaced:string -> OpamCLIVersion.t -> validity
val cli_original : validity
val cli2_0 : OpamCLIVersion.t
val cli2_1 : OpamCLIVersion.t
val cli2_2 : OpamCLIVersion.t
val cli2_3 : OpamCLIVersion.t
val mk_flag : cli:OpamCLIVersion.Sourced.t -> validity -> section:string -> string list -> string -> bool Cmdliner.Term.t
val mk_flag_replaced : cli:OpamCLIVersion.Sourced.t -> section:string -> (validity * string list) list -> string -> bool Cmdliner.Term.t
val mk_opt : cli:OpamCLIVersion.Sourced.t -> validity -> section:string -> ?vopt:'a -> string list -> string -> string -> 'a Cmdliner.Arg.conv -> 'a -> 'a Cmdliner.Term.t
val mk_opt_all : cli:OpamCLIVersion.Sourced.t -> validity -> section:string -> ?vopt:'a -> ?default:'a list -> string list -> string -> string -> 'a Cmdliner.Arg.conv -> 'a list Cmdliner.Term.t
val mk_vflag : cli:OpamCLIVersion.Sourced.t -> section:string -> 'a -> (validity * 'a * string list * string) list -> 'a Cmdliner.Term.t
val mk_vflag_all : cli:OpamCLIVersion.Sourced.t -> section:string -> ?default:'a list -> (validity * 'a * string list * string) list -> 'a list Cmdliner.Term.t
val mk_enum_opt : cli:OpamCLIVersion.Sourced.t -> validity -> section:string -> string list -> string -> (validity * string * 'a) list -> string -> 'a option Cmdliner.Term.t
val mk_enum_opt_all : cli:OpamCLIVersion.Sourced.t -> validity -> section:string -> string list -> string -> (validity * string * 'a) list -> string -> 'a list Cmdliner.Term.t

opt_all with enums. Check each flag content cli, purge non corresponding ones from the final result. If after purge the resulting list is empty (all removed or newer flag contents), it raises an error ; otherwise only display warnings on wrong cli contents.

val string_of_enum : (validity * string * 'a) list -> string
type 'a subcommand = validity * string * 'a * string list * string
type 'a subcommands = 'a subcommand list
val mk_subcommands : cli:OpamCLIVersion.Sourced.t -> 'a subcommands -> 'a option Cmdliner.Term.t * string list Cmdliner.Term.t
type 'a default = [> `default of string ] as 'a
val mk_subcommands_with_default : cli:OpamCLIVersion.Sourced.t -> 'a default subcommands -> 'a option Cmdliner.Term.t * string list Cmdliner.Term.t
val bad_subcommand : cli:OpamCLIVersion.Sourced.t -> 'a default subcommands -> (string * 'a option * string list) -> 'b Cmdliner.Term.ret
val mk_subdoc : cli:OpamCLIVersion.Sourced.t -> ?defaults:(string * string) list -> ?extra_defaults:(validity * string * string) list -> 'a subcommands -> Cmdliner.Manpage.block list
type command = unit Cmdliner.Term.t * Cmdliner.Cmd.info
val mk_command : cli:OpamCLIVersion.Sourced.t -> validity -> (cli:OpamCLIVersion.Sourced.t -> string -> doc:string -> man:Cmdliner.Manpage.block list -> Cmdliner.Cmd.info) -> string -> doc:string -> man:Cmdliner.Manpage.block list -> (unit -> unit) Cmdliner.Term.t -> command
val mk_command_ret : cli:OpamCLIVersion.Sourced.t -> validity -> (cli:OpamCLIVersion.Sourced.t -> string -> doc:string -> man:Cmdliner.Manpage.block list -> Cmdliner.Cmd.info) -> string -> doc:string -> man:Cmdliner.Manpage.block list -> (unit -> unit Cmdliner.Term.ret) Cmdliner.Term.t -> command
val env_with_cli : (string * validity * (string -> OpamStd.Config.E.t) * string) list -> (OpamCLIVersion.Sourced.t -> Cmdliner.Manpage.block list) * (OpamCLIVersion.Sourced.t -> unit)
val is_original_cli : validity -> bool
OCaml

Innovation. Community. Security.