From 4e5169fdcd2069e613a61c2a1a2a8743f7c3cd58 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Thu, 5 Feb 2026 14:40:53 +0000 Subject: [PATCH] Initial upload with CI/CD workflow --- src/main.rs | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/main.rs diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..f67e89b --- /dev/null +++ b/src/main.rs @@ -0,0 +1,64 @@ +use anyhow::Result; +use clap::Parser; +use std::process; + +mod cli; +mod core; +mod export; +mod models; +mod tui; + +use cli::Args; +use core::analyzer::Analyzer; +use export::exporter::Exporter; +use tui::app::TuiApp; + +fn main() { + if let Err(e) = run() { + eprintln!("Error: {}", e); + process::exit(1); + } +} + +fn run() -> Result<()> { + let args = Args::parse(); + + match &args.command { + cli::Commands::Analyze(analyze_args) => { + let analyzer = Analyzer::new(&analyze_args.path, &args.config)?; + let items = analyzer.analyze()?; + let exporter = Exporter::new(); + + if let Some(output) = &analyze_args.output { + exporter.export_json(&items, output)?; + } else { + exporter.print_summary(&items); + } + } + cli::Commands::Tui(tui_args) => { + let analyzer = Analyzer::new(&tui_args.path, &args.config)?; + let items = analyzer.analyze()?; + let mut app = TuiApp::new(items, tui_args.path.clone()); + app.run()?; + } + cli::Commands::Export(export_args) => { + let analyzer = Analyzer::new(&export_args.path, &args.config)?; + let items = analyzer.analyze()?; + let exporter = Exporter::new(); + + match export_args.format { + cli::ExportFormat::Json => { + exporter.export_json(&items, &export_args.output)?; + } + cli::ExportFormat::Markdown => { + exporter.export_markdown(&items, &export_args.output)?; + } + } + } + cli::Commands::Init(init_args) => { + cli::init_config(&init_args.path)?; + } + } + + Ok(()) +}