MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / emit_if_hidden

Function emit_if_hidden

atomic-cli/src/output/progress.rs:232–236  ·  view source on GitHub ↗

Write a completion message directly to stderr when the progress bar is hidden. `indicatif` defaults to a stderr draw target that suppresses itself when stderr is not a terminal. That is the right call for the *animation* — a spinner in a log file is noise — but `finish_with_message` goes through the same draw target, so the final outcome line disappeared along with it. A piped `atomic view switch

(pb: &ProgressBar, prefix: &str, message: &str)

Source from the content-addressed store, hash-verified

230/// So when the bar is hidden, emit the message ourselves. Plain text, no ANSI:
231/// the consumer is a pipe, a CI log, or an agent.
232fn emit_if_hidden(pb: &ProgressBar, prefix: &str, message: &str) {
233 if pb.is_hidden() {
234 eprintln!("{} {}", prefix, message);
235 }
236}
237
238/// Finish a progress bar with a success message.
239///

Callers 3

finish_successFunction · 0.85
finish_warningFunction · 0.85
finish_errorFunction · 0.85

Calls 1

is_hiddenMethod · 0.80

Tested by

no test coverage detected