OpamConsoleGlobal configuration parameters (read from OpamGlobalConfig, and the environment when necessary)
General text formatting
Settable attributes for ANSI terminal output. Nesting is generally not handled.
val colorise : text_style -> string -> stringHelper coloring functions. Returns the string unchanged if color is disabled
val acolor : text_style -> out_channel -> string -> unitval acolor_w : int -> text_style -> out_channel -> string -> unitLogging
Timers, only active when debug is on. Returns the time between the application to each argument, in seconds
val log : string -> ?level:int -> ('a, out_channel, unit) format -> 'alog section ~level fmt args. Used for debug messages, default level is 1
val slog : ('a -> string) -> out_channel -> 'a -> unitHelper 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) format4 -> 'aval warning : ('a, unit, string, unit) format4 -> 'aval note : ('a, unit, string, unit) format4 -> 'aval errmsg : ('a, out_channel, unit, unit, unit, unit) format6 -> 'aMessage without prefix, reformat or newline, to stderr (useful to continue error messages without repeating "ERROR")
val error_and_exit : ?num:int -> ('a, unit, string, 'b) format4 -> 'aval msg : ('a, out_channel, unit, unit) format4 -> 'aval formatted_msg : ?indent:int -> ('a, unit, string, unit) format4 -> 'aval header_msg : ('a, unit, string, unit) format4 -> 'aval status_line : ('a, out_channel, unit, unit, unit, unit) format6 -> 'aDisplay 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) format4 -> 'aAsk the user to press Y/y/N/n to continue (returns a boolean). Defaults to true (yes) if unspecified
val read : ('a, unit, string, string option) format4 -> 'aRead some input from the user (returns a string option)