package opam-client

  1. Overview
  2. Docs

Module OpamArgSource

Command-line argument parsers and helpers

Helpers and argument constructors

Sourceval mk_flag : ?section:string -> string list -> string -> bool Cmdliner.Term.t
Sourceval mk_opt : ?section:string -> ?vopt:'a -> string list -> string -> string -> 'a Cmdliner.Arg.converter -> 'a -> 'a Cmdliner.Term.t
Sourceval mk_opt_all : ?section:string -> ?vopt:'a -> ?default:'a list -> string list -> string -> string -> 'a Cmdliner.Arg.converter -> 'a list Cmdliner.Term.t

Flags

Sourceval print_short_flag : bool Cmdliner.Term.t

--short

Sourceval installed_roots_flag : bool Cmdliner.Term.t

--installed-root

Sourceval shell_opt : OpamTypes.shell option Cmdliner.Term.t

--shell

Sourceval dot_profile_flag : OpamTypes.filename option Cmdliner.Term.t

--dot-profile

Sourceval repo_kind_flag : OpamUrl.backend option Cmdliner.Term.t

--http/ --git/ --local

Sourceval jobs_flag : int option Cmdliner.Term.t

--jobs

Sourceval name_list : OpamTypes.name list Cmdliner.Term.t

package names

Sourceval param_list : string list Cmdliner.Term.t

parameters

Sourceval atom_list : OpamFormula.atom list Cmdliner.Term.t

package list with optional constraints

Sourceval nonempty_atom_list : OpamFormula.atom list Cmdliner.Term.t

package list with optional constraints

Sourceval atom_or_local_list : [ `Atom of OpamTypes.atom | `Filename of OpamTypes.filename | `Dirname of OpamTypes.dirname ] list Cmdliner.Term.t
Sourceval atom_or_dir_list : [ `Atom of OpamTypes.atom | `Dirname of OpamTypes.dirname ] list Cmdliner.Term.t
Sourceval arg_list : string -> string -> 'a Cmdliner.Arg.converter -> 'a list Cmdliner.Term.t

Generic argument list builder

Sourceval nonempty_arg_list : string -> string -> 'a Cmdliner.Arg.converter -> 'a list Cmdliner.Term.t

Generic argument list builder

Global options

Sourcetype global_options = {
  1. debug_level : int option;
  2. verbose : int;
  3. quiet : bool;
  4. color : [ `Always | `Never | `Auto ] option;
  5. opt_switch : string option;
  6. yes : bool;
  7. strict : bool;
  8. opt_root : OpamTypes.dirname option;
  9. git_version : bool;
  10. external_solver : string option;
  11. use_internal_solver : bool;
  12. cudf_file : string option;
  13. solver_preferences : string option;
  14. best_effort : bool;
  15. safe_mode : bool;
  16. json : string option;
  17. no_auto_upgrade : bool;
  18. working_dir : bool;
  19. ignore_pin_depends : bool;
}

Type for global options

Global options

Sourceval apply_global_options : global_options -> unit

Apply global options

Build options

Sourcetype build_options

Abstract type for build options

Sourceval build_option_section : string

Build options

Sourceval assume_built : bool Cmdliner.Term.t

Instal and reinstall options

Sourceval apply_build_options : build_options -> unit

Applly build options

Package listing and filtering options

Sourceval package_selection_section : string

Man section name

Sourceval package_selection : OpamListCommand.selector list Cmdliner.Term.t

Build a package selection filter

Sourceval package_listing_section : string

Man section name

Sourceval package_listing : (force_all_versions:bool -> OpamListCommand.package_listing_format) Cmdliner.Term.t

Package selection filter based on the current state of packages (installed, available, etc.)

Converters

Sourceval repository_name : OpamTypes.repository_name Cmdliner.Arg.converter

Repository name converter

Sourceval url : OpamTypes.url Cmdliner.Arg.converter

URL converter

Sourceval filename : OpamTypes.filename Cmdliner.Arg.converter

Filename converter

Sourceval existing_filename_or_dash : OpamTypes.filename option Cmdliner.Arg.converter

Filename converter also accepting "-" for stdin/stdout

Sourceval dirname : OpamTypes.dirname Cmdliner.Arg.converter

Dirnam converter

Sourceval existing_filename_dirname_or_dash : OpamFilename.generic_file option Cmdliner.Arg.converter
Sourceval positive_integer : int Cmdliner.Arg.converter
Sourceval package_name : OpamTypes.name Cmdliner.Arg.converter

Package name converter

Sourceval package : (OpamTypes.name * OpamTypes.version option) Cmdliner.Arg.converter

name{.version} (or name=version)

Sourceval package_with_version : OpamTypes.package Cmdliner.Arg.converter

name.version (or name=version)

Sourceval atom : OpamTypes.atom Cmdliner.Arg.converter

name{(.|=|!=|>|<|>=|<=)version} converter

Sourceval atom_or_local : [ `Atom of OpamTypes.atom | `Filename of OpamTypes.filename | `Dirname of OpamTypes.dirname ] Cmdliner.Arg.converter

Accepts atom but also (explicit) file and directory names

Sourceval atom_or_dir : [ `Atom of OpamTypes.atom | `Dirname of OpamTypes.dirname ] Cmdliner.Arg.converter
Sourceval variable_bindings : (OpamVariable.t * string) list Cmdliner.Arg.converter

var=value,... argument

Sourceval warn_selector : (int * bool) list Cmdliner.Arg.converter

Warnings string "+3..10-4"

Sourcetype 'a default = [> `default of string ] as 'a
Sourceval enum_with_default : (string * 'a default) list -> 'a Cmdliner.Arg.converter

Enumeration with a default command

Subcommands

Sourcetype 'a subcommand = string * 'a * string list * string

A subcommand cmds, v, args, doc is the subcommand cmd, using the documentation doc and the list of documentation parameters args. If the subcommand is selected, return v.

Sourcetype 'a subcommands = 'a subcommand list
Sourceval mk_subcommands : 'a subcommands -> 'a option Cmdliner.Term.t * string list Cmdliner.Term.t

subcommands cmds are the terms cmd and params. cmd parses which sub-commands in cmds is selected and params parses the remaining of the command-line parameters as a list of strings.

Sourceval mk_subcommands_with_default : 'a default subcommands -> 'a option Cmdliner.Term.t * string list Cmdliner.Term.t

Same as mk_subcommand but use the default value if no sub-command is selected.

Sourceval make_command_alias : ('a Cmdliner.Term.t * Cmdliner.Term.info) -> ?options:string -> string -> 'a Cmdliner.Term.t * Cmdliner.Term.info

Create an alias for an existing command. options can be used to add extra options after the original command in the doc (eg like `unpin` is an alias for `pin remove`).

Sourceval bad_subcommand : 'a default subcommands -> (string * 'a option * string list) -> 'b Cmdliner.Term.ret

bad_subcommand cmds cmd is a command return value denoting a parsing error of sub-commands.

Sourceval mk_subdoc : ?defaults:(string * string) list -> 'a subcommands -> Cmdliner.Manpage.block list

mk_subdoc cmds is the documentation block for cmds.

Misc

Documentation

Sourceval global_option_section : string
Sourceval help_sections : Cmdliner.Manpage.block list
Sourceval term_info : string -> doc:string -> man:Cmdliner.Manpage.block list -> Cmdliner.Term.info
OCaml

Innovation. Community. Security.