package opam-client

  1. Overview
  2. Docs

Functions handling the "opam switch" subcommand

Install a new switch, with the given packages set as compiler. The given global_state is unlocked as soon as possible, i.e. after registering the existence of the new switch. update_config sets the switch as current globally, unless it is external

Import a file which contains the packages to install.

val export : ?full:bool -> OpamFile.SwitchExport.t OpamFile.t option -> unit

Export a file which contains the installed packages. If full is specified and true, export metadata of all installed packages (excluding overlay files) as part of the export. None means export to stdout.

Remove the given compiler switch, and returns the updated state (unchanged in case confirm is true and the user didn't confirm)

Switch to the given compiler switch, installing it if it doesn't exist already (with the given compiler, or empty if unspecified).

Sets the packages configured as the current switch compiler base

val show : unit -> unit

Display the current compiler switch.

val list : 'a OpamStateTypes.global_state -> print_short:bool -> unit

List all the available compiler switches.

val get_compiler_packages : ?repos:OpamTypes.repository_name list -> 'a OpamStateTypes.repos_state -> OpamTypes.package_set

Returns all available compiler packages from a repo state

val guess_compiler_package : ?repos:OpamTypes.repository_name list -> 'a OpamStateTypes.repos_state -> string -> OpamTypes.atom list

Guess the compiler from the switch name: within compiler packages, match name against "pkg.version", "pkg", and, as a last resort, "version" (for compat with older opams, eg. 'opam switch 4.02.3')

OCaml

Innovation. Community. Security.