package matrix

Build not yet checked
  1. Overview
  2. Docs
Fast, modern terminal toolkit for OCaml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

mosaic-0.3.0.tbz
sha256=a92cbbcbe016fb19fb0a749222da0e459a9567aef3f4c7340d9bd6b71c53ed6f
sha512=6a7ab054605538bb31a2b73a1a6d093981a2704c9f0af5852221c05735290d74aca7c7282298c4d0f91e86a800e2ccd94b4918af883cd963449c758eb6b272b3

doc/matrix.cli/Matrix_cli/Progress/index.html

Module Matrix_cli.ProgressSource

How a program's progress shows on a destination.

A program's progress is what it shows of its work while it works. On a destination it shows in one mode (Progress.t): rows redrawn in place (`Tty), lines printed as the work goes (`Plain), only what fails (`Quiet), or one JSON event a line for another program to read (`Json). A --progress option chooses a mode or `Auto, and Progress.decide gives a destination its mode for that choice, as Ansi.Styling.decide gives it a styling for --color.

Sourcetype choice = [
  1. | `Auto
  2. | `Tty
  3. | `Plain
  4. | `Quiet
  5. | `Json
]

The type for a program's choices.

Sourcetype t = [
  1. | `Tty
  2. | `Plain
  3. | `Quiet
  4. | `Json
]

The type for modes.

Sourceval choices : (string * choice) list

choices is the choices as a --progress option names them, auto, tty, plain, quiet and json, in that order, as Cmdliner.Arg.enum takes them.

Sourceval decide : ?progress:choice -> (string -> string option) -> tty:bool -> dumb:bool -> t

decide ~progress getenv ~tty ~dumb is the mode of a destination, which is a terminal iff tty and a dumb one iff dumb, for the program's choice progress (`Auto by default), reading the environment with getenv. `Auto is `Tty on a terminal that is not dumb outside a continuous integration job, and `Plain elsewhere. A job keeps its output as a log that replays line by line, where redrawn rows pile up, and the process is in one when CI is set to anything but the empty string, 0 or false. cargo counts any value. `Tty is `Tty on a terminal that is not dumb, in such a job too, and `Plain elsewhere, since rows are redrawn with the cursor motions only a terminal performs. The other choices are their modes.