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 run;
9#[cfg(feature = "schedule")]
10pub mod schedule;
11pub mod schema;
12#[cfg(feature = "serve")]
13pub mod serve;
14pub mod validate;
15
16use crate::error::CliError;
17
18/// Render any [`CliError`] to a single line on stderr, scrubbing any resolved
19/// secret values that may have reached the error chain.
20pub fn report(err: &CliError) {
21    use crate::secrets::registry::redact;
22    eprintln!("error: {}", redact(&err.to_string()));
23    let mut src = std::error::Error::source(err);
24    while let Some(s) = src {
25        eprintln!("  caused by: {}", redact(&s.to_string()));
26        src = std::error::Error::source(s);
27    }
28}