report/report.rs
1//! Run every detection check without short-circuiting and print which
2//! ones match in the current environment. Useful inside dev containers,
3//! CI runners, and odd Linux setups for understanding *why* the crate
4//! returned what it did.
5//!
6//! Run with:
7//!
8//! ```text
9//! cargo run --example report --features diagnostics
10//! ```
11
12fn main() {
13 let report = detect_container::diagnostics::report();
14 println!("is_container() = {}", report.is_container);
15 println!();
16 println!("{:<32} {:<7} description", "check", "matched");
17 println!(
18 "{:<32} {:<7} {}",
19 "-".repeat(32),
20 "-------",
21 "-".repeat(40)
22 );
23 for c in &report.checks {
24 println!(
25 "{:<32} {:<7} {}",
26 c.name,
27 if c.matched { "yes" } else { "no" },
28 c.description
29 );
30 }
31}