package matrix
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.
The type for a program's choices.
The type for modes.
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.
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.