From 2581cdd87ade4e045f6145daeb5e0321ede341b9 Mon Sep 17 00:00:00 2001 From: Adir Shitrit Date: Sat, 8 Nov 2025 11:48:20 +0200 Subject: [PATCH] add command line options for output format and verbosity --- ghost-cli/src/main.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/ghost-cli/src/main.rs b/ghost-cli/src/main.rs index f8e9089..0450c0d 100644 --- a/ghost-cli/src/main.rs +++ b/ghost-cli/src/main.rs @@ -1,11 +1,37 @@ use anyhow::Result; +use clap::{Arg, Command}; use ghost_core::{memory, process, thread, DetectionEngine, ThreatLevel}; +use std::time::Instant; fn main() -> Result<()> { env_logger::init(); + let matches = Command::new("ghost") + .version("0.1.0") + .about("Cross-Platform Process Injection Detection Framework") + .arg( + Arg::new("format") + .short('f') + .long("format") + .value_name("FORMAT") + .help("Output format: table, json") + .default_value("table") + ) + .arg( + Arg::new("verbose") + .short('v') + .long("verbose") + .help("Enable verbose output") + .action(clap::ArgAction::SetTrue) + ) + .get_matches(); + + let format = matches.get_one::("format").unwrap(); + let verbose = matches.get_flag("verbose"); + println!("Ghost v0.1.0 - Process Injection Detection\n"); + let scan_start = Instant::now(); let mut engine = DetectionEngine::new(); let processes = process::enumerate_processes()?;