package opam-client

  1. Overview
  2. Docs

Functions handling the "opam list" subcommand

type dependency_toggles = {
  1. recursive : bool;
  2. depopts : bool;
  3. build : bool;
  4. test : bool;
  5. doc : bool;
  6. dev : bool;
}

Switches to determine what to include when querying (reverse) dependencies

val default_dependency_toggles : dependency_toggles
type pattern_selector = {
  1. case_sensitive : bool;
  2. exact : bool;
  3. glob : bool;
  4. fields : string list;
  5. ext_fields : bool;
    (*

    Match on raw strings in x-foo fields

    *)
}
val default_pattern_selector : pattern_selector
type selector =
  1. | Any
  2. | Installed
  3. | Root
  4. | Compiler
  5. | Available
  6. | Installable
  7. | Pinned
  8. | Depends_on of dependency_toggles * OpamTypes.atom list
  9. | Required_by of dependency_toggles * OpamTypes.atom list
  10. | Solution of dependency_toggles * OpamTypes.atom list
  11. | Pattern of pattern_selector * string
  12. | Atoms of OpamTypes.atom list
  13. | Flag of OpamTypes.package_flag
  14. | Tag of string
  15. | From_repository of OpamTypes.repository_name list

Package selectors used to filter the set of packages

Applies a formula of selectors to filter the package from a given switch state

val print_depexts : 'a OpamStateTypes.switch_state -> OpamTypes.package_set -> string list -> unit

Lists the external dependencies matching the given flags for the given set of packages

type output_format =
  1. | Name
    (*

    Name without version

    *)
  2. | Version
    (*

    Version of the currently looked-at package

    *)
  3. | Package
    (*

    name.version

    *)
  4. | Synopsis
    (*

    One-line package description

    *)
  5. | Synopsis_or_target
    (*

    Pinning target if pinned, synopsis otherwise

    *)
  6. | Description
    (*

    The package description, excluding synopsis

    *)
  7. | Field of string
    (*

    The value of the given opam-file field

    *)
  8. | Installed_version
    (*

    Installed version or "--" if none

    *)
  9. | Pinning_target
    (*

    Empty string if not pinned

    *)
  10. | Raw
    (*

    The full contents of the opam file (reformatted)

    *)
  11. | All_installed_versions
    (*

    List of the installed versions in all switches with the corresponding switches in brackets

    *)
  12. | Available_versions
    (*

    List of the available versions (currently installed one in bold if color enabled)

    *)
  13. | All_versions
    (*

    List of the existing package versions (installed, installed in current switch and unavailable colored specifically if color enabled)

    *)
  14. | Repository
    (*

    The repository the package was found in (may be empty for pinned packages)

    *)
  15. | Installed_files
    (*

    The list of files that the installed package added to the system

    *)

Element of package information to be printed

val default_list_format : output_format list

Gets either the current switch state, if a switch is selected, or a virtual state corresponding to the configured repos

val field_names : (output_format * string) list

For documentation, includes a dummy '<field>:' for the Field format

val string_of_field : output_format -> string
val field_of_string : string -> output_format
val display : 'a OpamStateTypes.switch_state -> header:bool -> format:output_format list -> dependency_order:bool -> all_versions:bool -> ?wrap:[ `Wrap of string | `Truncate | `None ] -> ?separator:string -> ?prettify:bool -> ?normalise:bool -> ?order:(OpamTypes.package -> OpamTypes.package -> int) -> OpamTypes.package_set -> unit

Outputs a list of packages as a table according to the formatting options. normalise supersedes prettify and uses a canonical way of displaying package definition file fields. prettify uses a nicer to read format for the package definition file fields.

val list : 'a OpamStateTypes.global_state -> print_short:bool -> filter:[ `all | `installed | `roots | `installable ] -> order:[ `normal | `depends ] -> exact_name:bool -> case_sensitive:bool -> ?depends:OpamTypes.atom list -> ?reverse_depends:bool -> ?recursive_depends:bool -> ?resolve_depends:bool -> ?depopts:bool -> ?depexts:string list -> ?dev:bool -> string list -> unit

Display all available packages that match any of the regexps.

val info : 'a OpamStateTypes.global_state -> fields:string list -> raw_opam:bool -> where:bool -> ?normalise:bool -> ?show_empty:bool -> OpamTypes.atom list -> unit

Display a general summary of a collection of packages.

val mini_field_printer : ?prettify:bool -> ?normalise:bool -> OpamTypes.value -> string

Prints the value of an opam field in a shortened way (with prettify -- the default -- puts lists of strings in a format that is easier to read

val string_of_formula : selector OpamFormula.formula -> string
OCaml

Innovation. Community. Security.