//! Colored output helpers and filename utilities for WTIsMyCode CLI use colored::Colorize; use wtismycode_core::ProjectModel; /// Sanitize a file path into a safe filename for docs. /// Removes `./` prefix, replaces `/` with `__`. pub fn sanitize_filename(filename: &str) -> String { let cleaned = filename.strip_prefix("./").unwrap_or(filename); cleaned.replace('/', "__") } pub fn print_generate_summary(model: &ProjectModel) { println!(); println!("{}", "── Summary ──────────────────────────".dimmed()); println!(" {} {}", "Files:".bold(), model.files.len()); println!(" {} {}", "Modules:".bold(), model.modules.len()); println!(" {} {}", "Symbols:".bold(), model.symbols.len()); println!(" {} {}", "Edges:".bold(), model.edges.module_import_edges.len() + model.edges.symbol_call_edges.len()); if !model.classified_integrations.is_empty() { let cats: Vec = model.classified_integrations.iter() .filter(|(_, pkgs)| !pkgs.is_empty()) .map(|(cat, pkgs)| format!("{} ({})", cat, pkgs.join(", "))) .collect(); if !cats.is_empty() { println!(" {} {}", "Integrations:".bold(), cats.join(" | ").yellow()); } } println!("{}", "─────────────────────────────────────".dimmed()); }