# Module OpamGlobals

    module OpamGlobals: sig .. end

Convention: all the global OPAM variables can be set using environment variables using OPAM<variable>

    val debug : bool Pervasives.ref

    val debug_level : int Pervasives.ref

    val verbose : bool Pervasives.ref

    val verbose_level : int Pervasives.ref

    val color_when : [> `Always | `Auto | `Never ]

    val color : bool Pervasives.ref

    val disp_status_line : unit -> bool

    val utf8_when : [> `Always | `Auto | `Never ]

    val utf8 : bool Pervasives.ref

    val keep_build_dir : bool Pervasives.ref

    val no_base_packages : bool Pervasives.ref

    val no_checksums : bool Pervasives.ref

    val req_checksums : bool Pervasives.ref

    val yes : bool Pervasives.ref

    val strict : bool Pervasives.ref

    val build_test : bool Pervasives.ref

    val build_doc : bool Pervasives.ref

    val show : bool Pervasives.ref

    val dryrun : bool Pervasives.ref

    val fake : bool Pervasives.ref

    val print_stats : bool Pervasives.ref

    val utf8_msgs : bool Pervasives.ref

    val do_not_copy_files : bool Pervasives.ref

    val sync_archives : bool Pervasives.ref

    val use_external_solver : bool Pervasives.ref

    val no_self_upgrade : bool Pervasives.ref

    val skip_version_checks : bool Pervasives.ref

    val safe_mode : bool Pervasives.ref

    val lock_retries : int Pervasives.ref

    val pin_kind_auto : bool Pervasives.ref

    val all_parens : bool Pervasives.ref

Tells the printer to write parens everywhere

    val self_upgrade_bootstrapping_value : string

    val is_self_upgrade : bool

    val jobs : int option Pervasives.ref

    val dl_jobs : int option Pervasives.ref

    val download_retry : int

    val cudf_file : string option Pervasives.ref

    val solver_timeout : float

    type solver_criteria = [ `Default | `Fixup | `Upgrade ]

    val default_preferences : solver_criteria -> string

    val compat_preferences : solver_criteria -> string

    val solver_preferences : (solver_criteria * string) list Pervasives.ref

Solver preference bindings. Used with List.assoc: first one wins

    val get_solver_criteria : [ `Default | `Fixup | `Upgrade ] -> string

Get the currently configured solver criteria as a string

    val env_external_solver : string option Pervasives.ref

    val default_external_solver : string

    val external_solver_ref : (input:string -> output:string -> criteria:string -> string list) option
           Pervasives.ref

    val external_solver : input:string -> output:string -> criteria:string -> string list

    type download_tool = [ `Curl
           | `Custom of
               url:string ->
               out:string ->
               retry:int -> ?checksum:string -> compress:bool -> string list
           | `Wget ]

    val download_tool_env : string option Pervasives.ref

    val download_tool : download_tool option Pervasives.ref

    val curl_command : string

    val default_repository_name : string

    val default_repository_address : string

    val search_files : string list Pervasives.ref

    val global_config : string

    val system : string

    val switch : [ `Command_line of string | `Env of string | `Not_set ] Pervasives.ref

    val external_tags : string list Pervasives.ref

    val home : string

    val default_opam_dir : string

    val root_dir : string Pervasives.ref

    val root_dir_tmp : string

The initial value of root_dir, set in the tmpdir before initialised

    val timer : unit -> unit -> float

    val global_start_time : float

    type text_style = [ `black
           | `blue
           | `bold
           | `cyan
           | `green
           | `magenta
           | `red
           | `underline
           | `white
           | `yellow ]

    val colorise : text_style -> string -> string

not nestable

    val acolor : text_style -> Pervasives.out_channel -> string -> unit

    val acolor_w : int -> text_style -> Pervasives.out_channel -> string -> unit

    val timestamp : unit -> string

    val log : string ->
           ?level:int -> ('a, Pervasives.out_channel, unit) Pervasives.format -> 'a

`log section ~level fmt args`. Used for debug messages, default level is 1

    val slog : ('a -> string) -> Pervasives.out_channel -> 'a -> unit

Helper to pass stringifiers to log (use `log "%a" (slog to_string) x` rather than `log "%s" (to_string x)` to avoid costly unneeded stringifications

    val error : ('a, unit, string, unit) Pervasives.format4 -> 'a

    val warning : ('a, unit, string, unit) Pervasives.format4 -> 'a

    val note : ('a, unit, string, unit) Pervasives.format4 -> 'a

    val errmsg : ('a, Pervasives.out_channel, unit, unit, unit, unit) Pervasives.format6 -> 'a

Message without prefix, reformat or newline, to stderr (useful to continue error messages without repeating "`ERROR`")

    exception Exit of int

Raised to exit the program in a clean way. Parameter is the exit code.

    exception Exec of string * string array * string array

Raised to `exec()` another binary, after making sure finalisations have been made properly. Parameters as per `Unix.execvpe`

    exception Package_error of string

    val error_and_exit : ('a, unit, string, 'b) Pervasives.format4 -> 'a

    val msg : ('a, Pervasives.out_channel, unit, unit) Pervasives.format4 -> 'a

    val formatted_msg : ?indent:int -> ('a, unit, string, unit) Pervasives.format4 -> 'a

    val header_msg : ('a, unit, string, unit) Pervasives.format4 -> 'a

    val header_error : ('a, unit, string, ('b, unit, string, unit) Pervasives.format4 -> 'b)
           Pervasives.format4 -> 'a

    val status_line : ('a, Pervasives.out_channel, unit, unit, unit, unit) Pervasives.format6 -> 'a

Display a dynamic status line to stdout, that will be erased on next output. The message should not be wider than screen nor contain newlines.

    val confirm : ?default:bool -> ('a, unit, string, bool) Pervasives.format4 -> 'a

Ask the user to press Y/y/N/n to continue (returns a boolean). Defaults to true (yes) if unspecified

Read some input from the user (returns a string option)

    val read : ('a, unit, string, string option) Pervasives.format4 -> 'a

    val editor : string lazy_t

    type os =

`|` | `Darwin`
`|` | `Linux`
`|` | `FreeBSD`
`|` | `OpenBSD`
`|` | `NetBSD`
`|` | `DragonFly`
`|` | `Cygwin`
`|` | `Win32`
`|` | `Unix`
`|` | `Other of `string``

    val os : unit -> os

    val os_string : unit -> string

    val arch : unit -> string

    val makecmd : (unit -> string) Pervasives.ref

    val log_limit : int

    val log_line_limit : int

    val default_jobs : int

    val default_dl_jobs : int

    val exit : int -> 'a