Colour
lemano colours the text it prints for people, sparingly, and only where
someone reads it on a terminal.
| Where | Colour |
|---|---|
| A change marker and its line, in a diff or a revert plan | + green, ~ yellow, - red |
| Lines of a content diff | added green, removed red, hunk headers dim, file headers bold |
Section headings (Objects:, Files:, Plan:, Results:, Attribution:) | bold |
discover RESULT | changed and partial yellow, unreachable and failures red, unchanged dim |
Conditions in lists and in summary | yellow, Failed red |
| Who changed an object | bold |
| What a revert did | applied green, failed red, skipped yellow |
| The questions a revert asks | bold |
| An error | error: red |
Columns are padded by the width the text shows, so a table lines up with or without colour.
When colour is off
Colour is written to a stream only when all of these hold:
- the stream (standard output for the text of a command, standard error for errors) is a terminal;
--no-coloris not given;NO_COLORis not set to a value;TERMis notdumb.
FORCE_COLOR, set to anything but empty, 0 or false, turns colour on
for a stream that is not a terminal, when TERM is dumb, and over
NO_COLOR, so it can be set for one run. --no-color still turns it off,
since a flag given on the command line overrides the environment.
The machine formats never carry colour: -o json and -o yaml (and the
error that ends such a run), summary -o prometheus, and anything written
to a file with --out.