Module output

Module output 

Source
Expand description

Shared presentation: the colour decision, the field-tinted styling the capture decoder needs, and the key/value report layout every command prints.

Enums§

ColorChoice
When decoded output carries ANSI colour.

Constants§

LABEL_WIDTH 🔒
Column at which a report’s values line up. Wide enough for the longest label a report prints (capabilities:).

Statics§

COLOR 🔒
Resolved once at startup so every module can ask without threading a flag through call after call. A tool this shape has exactly one output stream and one answer for it.

Functions§

color
field
One line of a key/value report: label: in the left column, value in the right.
hex
Lowercase hex, no separators — the form every digest, id, and key in this tool’s output uses.
note
A note about what the tool just did, or declined to do. Stays on stdout with the rest of the report; failures go through Err.
set_color
styled
Wrap text in the given SGR parameters, or return it unchanged when the output is not colorized.
subfield
A nested line of a key/value report, indented under its parent.
warn
Something the user is likely to have gotten wrong, which did not stop the command from succeeding.