package opam-core
Install
Dune Dependency
Authors
-
David Allsopp
-
VVincent Bernardoff <vb@luminar.eu.org>
-
RRaja Boujbel <raja.boujbel@ocamlpro.com>
-
KKate Deplaix <kit-ty-kate@outlook.com>
-
RRoberto Di Cosmo <roberto@dicosmo.org>
-
TThomas Gazagnaire <thomas@gazagnaire.org>
-
LLouis Gesbert <louis.gesbert@ocamlpro.com>
-
FFabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
-
AAnil Madhavapeddy <anil@recoil.org>
-
GGuillem Rieu <guillem.rieu@ocamlpro.com>
-
RRalf Treinen <ralf.treinen@pps.jussieu.fr>
-
FFrederic Tuong <tuong@users.gforge.inria.fr>
Maintainers
Sources
md5=3a99d6d8c0394185f168fa0f085f6bb9
sha512=596d7b28f0cf9613dc7637aaeac45cc45f411a13286fea1cc81aeb0630c4f8a6dc2095d50db73229a255a3da3d9a08fe0993355a7fc64d3b16fd712789ff5f6e
doc/opam-core/OpamConsole/index.html
Module OpamConsole
Source
Console 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.
Helper coloring functions. Returns the string unchanged if color is disabled
Logging
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
")
Erase the current line on stdout (doesn't flush stdout)
Display 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 ->
('a, unit, string, bool) format4 ->
'a
Ask 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 ] ->
out_channel ->
sep:string ->
string list list ->
unit
Prints 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