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
4#[cfg(feature = "catalog")]
5pub mod catalog;
6#[cfg(feature = "contract")]
7pub mod contract;
8pub mod dlq;
9pub mod doctor;
10pub mod init;
11pub mod list;
12#[cfg(feature = "masking")]
13pub mod masking;
14#[cfg(feature = "notify")]
15pub mod notify;
16pub mod preview;
17pub mod replicate;
18pub mod run;
19#[cfg(feature = "schedule")]
20pub mod schedule;
21pub mod schema;
22#[cfg(feature = "serve")]
23pub mod serve;
24pub mod test;
25pub mod validate;
26
27use crate::error::CliError;
28
29/// Render any [`CliError`] to a single line on stderr, scrubbing any resolved
30/// secret values that may have reached the error chain.
31pub fn report(err: &CliError) {
32    use crate::secrets::registry::redact;
33    eprintln!("error: {}", redact(&err.to_string()));
34    let mut src = std::error::Error::source(err);
35    while let Some(s) = src {
36        eprintln!("  caused by: {}", redact(&s.to_string()));
37        src = std::error::Error::source(s);
38    }
39}