truman 0.1.0

Truman secret scanner facade — Rust library re-exporting core and detectors with collect and streaming APIs
Documentation
//! Minimal Truman library example.
//!
//! Run with: `cargo run -p truman --example quickstart [PATH...]`
//!
//! Scans the given paths (default: current directory) with all default
//! detectors and prints each finding with its exact position. This is the
//! smallest useful program built on the `truman` facade crate.

use std::path::PathBuf;

use truman::{default_registry_with_config, scan_paths_collect};

fn main() {
    let mut paths: Vec<PathBuf> = std::env::args().skip(1).map(PathBuf::from).collect();
    if paths.is_empty() {
        paths.push(PathBuf::from("."));
    }

    let (registry, config) = default_registry_with_config();
    let findings = scan_paths_collect(&paths, &config, &registry);

    for f in &findings {
        let s = &f.location.span;
        println!(
            "{}:{}:{}-{}: {} ({}) [{}]",
            f.location.file.display(),
            s.line,
            s.col_start,
            s.col_end,
            f.secret_type,
            f.detector,
            f.hashed_secret,
        );
    }
    println!("{} finding(s)", findings.len());
}