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§
- Color
Choice - 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
textin 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.