pub struct OutputConfig {
pub format: OutputFormat,
pub verbose: bool,
pub debug: bool,
pub quiet: bool,
pub color: bool,
}Expand description
Resolved output configuration for a CLI invocation.
Created once at startup via crate::cli::build_output_config and passed
down through command handlers.
Fields§
§format: OutputFormatOutput format (human or JSON)
verbose: boolWhether verbose output is enabled (includes --debug)
debug: boolWhether debug output is enabled (superset of verbose)
quiet: boolWhether quiet mode is active (suppress info/step output)
color: boolWhether ANSI color codes are allowed
Implementations§
Source§impl OutputConfig
impl OutputConfig
Sourcepub fn print_step(&self, message: &str)
pub fn print_step(&self, message: &str)
Print a step completion line in human mode.
Per D-01: each step that completes prints a checkmark prefix + message. In JSON mode, this is a no-op (JSON commands emit a single JSON object at end). In quiet mode, this is also suppressed.
Sourcepub fn print_substep(&self, message: &str)
pub fn print_substep(&self, message: &str)
Print an indented substep line in human mode.
Per D-04: substeps are indented bullet points under a parent step. Silent in JSON mode and quiet mode.
Sourcepub fn print_error(&self, error: &OlError)
pub fn print_error(&self, error: &OlError)
Print a formatted OlError to stderr.
In human mode: structured multi-line error with OL code, suggestion, and docs URL.
In JSON mode: JSON object on stderr with {"error": {...}}.
Sourcepub fn print_info(&self, message: &str)
pub fn print_info(&self, message: &str)
Print an informational message to stderr.
Silent in quiet mode and JSON mode.
Sourcepub fn print_json<T: Serialize>(&self, value: &T)
pub fn print_json<T: Serialize>(&self, value: &T)
Serialize a value as pretty JSON to stdout.
Used by commands to emit their JSON output. Silently skips serialization errors rather than panicking (logs a debug message instead).
Sourcepub fn create_spinner(&self, message: &str) -> Option<ProgressBar>
pub fn create_spinner(&self, message: &str) -> Option<ProgressBar>
Create an indicatif progress spinner writing to stderr.
Per CLI-11: progress spinners write to stderr, not stdout, so they don’t contaminate machine-parseable stdout output.
Returns None if quiet mode or JSON mode is active (no spinners in non-interactive
or machine-readable contexts).
Trait Implementations§
Source§impl Clone for OutputConfig
impl Clone for OutputConfig
Source§fn clone(&self) -> OutputConfig
fn clone(&self) -> OutputConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more