Expand description
Terminal output substrate for largo.
Central home for everything user-facing that is not command logic:
the CliError type rendered by the binary’s main, the process
exit-code conventions, the color/verbosity state shared by every
command, and the clap help palette.
All commands construct CliError (directly or via CliError::new /
CliError::with_hint) instead of ad-hoc string errors when they want
a hint line or a non-default exit code. Plain String errors continue
to work through Box<dyn Error> and render without a hint.
Every user-visible print goes through [anstream], so ANSI styling is
automatically stripped on pipes, honored under --color always, and
silenced by NO_COLOR — including styling embedded in engine-rendered
messages that pass through here.
Structs§
- CliError
- A user-facing CLI error: a message, an optional
help:hint, and the exit code the process should terminate with.
Enums§
- Color
Mode - The
--colormode selected on the command line.
Constants§
- CLAP_
STYLES - The cargo help palette for clap: bold-green headers/usage, bold-cyan literals, cyan placeholders.
- ERROR_
STYLE - Bold red — the
error:prefix. - EXIT_
FAILURE - Process exit code for a command failure (build error, proof failure,
dirty
fmt --check, parse error, …). - EXIT_OK
- Process exit code for success.
- EXIT_
USAGE - Process exit code for a usage error (bad arguments, reserved verb). Matches clap’s own convention for argument errors.
- HELP_
STYLE - Bold cyan — the
help:prefix. - PHASE_
STYLE - Bold green — phase headers (
Compiling,Finished, …), cargo-style. - WARN_
STYLE - Bold yellow — the
warning:prefix.
Functions§
- error
- Print one
error:block to stderr — for a command that reports several errors before it returns the last as its own. - info
- Print an informational line to stdout unless
--quietis active. - init
- Install the global output state from the parsed CLI flags.
- is_
quiet - Whether
--quietwas passed: informational output should be suppressed. - note
- Print a note to stderr unless
--quietis active — the line that accompanies an artifact on stdout (which lane, which chip) without polluting a redirect. - phase
- Print a cargo-style phase header (right-aligned bold-green verb) to
stderr unless
--quietis active. - render_
error - Render any top-level error to stderr in the
error:/help:style and return the exit code the process should use. - verbosity
- The
-vcount:0normal,1+increasingly chatty. - warning
- Print one
warning:block to stderr unless--quietis active.