Skip to main content

faucet_cli/commands/
mod.rs

1//! Subcommand implementations. Each module owns its `run(...)` entry point
2//! and stays free of clap so the integration tests can drive it directly.
3
4pub mod doctor;
5pub mod init;
6pub mod list;
7pub mod preview;
8pub mod replicate;
9pub mod run;
10#[cfg(feature = "schedule")]
11pub mod schedule;
12pub mod schema;
13#[cfg(feature = "serve")]
14pub mod serve;
15pub mod validate;
16
17use crate::error::CliError;
18
19/// Render any [`CliError`] to a single line on stderr, scrubbing any resolved
20/// secret values that may have reached the error chain.
21pub fn report(err: &CliError) {
22    use crate::secrets::registry::redact;
23    eprintln!("error: {}", redact(&err.to_string()));
24    let mut src = std::error::Error::source(err);
25    while let Some(s) = src {
26        eprintln!("  caused by: {}", redact(&s.to_string()));
27        src = std::error::Error::source(s);
28    }
29}