OpamConsoleConsole output, ANSI color, logging and user querying
Global 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 colorise' : text_style list -> string -> stringval acolor : text_style -> unit -> string -> stringval acolor_w : int -> text_style -> Stdlib.Format.formatter -> string -> unitmodule Symbols : sig ... endLogging
Timers, only active when debug is on. Returns the time between the application to each argument, in seconds
log section ~level fmt args. Used for debug messages, default level is 1
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
Message without prefix, reformat or newline, to stderr (useful to continue error messages without repeating "ERROR")
val error_and_exit :
OpamStd.Sys.exit_reason ->
('a, unit, string, 'b) Stdlib.format4 ->
'aDisplay a dynamic status line to stdout, that will be erased on next call. The message should not be wider than screen nor contain newlines. Use clear_status when the status line should be erased.
Erase the status line and restore the cursor to the start of the line
Show a prompt and wait for the user to press anything.
val confirm :
?require_unsafe_yes:bool ->
?default:bool ->
?name:string ->
('a, unit, string, bool) Stdlib.format4 ->
'aAsk the user to press Y/y/N/n to continue (returns a boolean). Defaults to true (yes) if unspecified. If require_unsafe_yes is true, it automatically answer yes to the question if automatic answering is set to `unsafe_yes ; otherwise it will prompt and wait user input if it is set `all_yes (interactive). Its default is false.
Prompts the user with multiple numbered choices (answer, message).
unsafe_yes, yes are the options to choose if the corresponding global options are set. no is the option to choose otherwise, when non interactive, on escape. default is the option to choose on an active empty input ("\n"). Max 35 options.
Read some input from the user (returns a string option)
val print_table :
?cut:[ `Wrap of string | `Truncate | `None ] ->
Stdlib.out_channel ->
sep:string ->
string list list ->
unitPrints a table; generally called on tables passed through align_table. The default cut is to wrap on stdout, stderr, keep as-is otherwise. `Wrap sep prepends sep on wrapped lines
module Tree : sig ... endTree printing