Added foundational modules for core functionalities:

- Introduced `walk.rs` as a parallel directory walker for search operations.
- Implemented basic index handling in `commands/index.rs`.
- Created `utils/config.rs` for configuration management with placeholders for future enhancements.
This commit is contained in:
elipeter 2025-06-16 16:46:22 +02:00
commit ab5558f537
16 changed files with 2187 additions and 0 deletions

29
src/commands/mod.rs Normal file
View file

@ -0,0 +1,29 @@
pub mod scan;
pub mod index;
pub mod list;
pub mod clean;
use crate::cli::Commands;
use std::path::Path;
use crate::utils::config::Config;
pub fn handle_command(
command: Commands,
database_dir: &Path,
config: &Config
) -> Result<(), Box<dyn std::error::Error>> {
match command {
Commands::Scan { path, no_index, rebuild_index, format, high_only } => {
scan::handle(&path, no_index, rebuild_index, format, high_only, database_dir, config)
}
Commands::Index { action } => {
index::handle(action, database_dir)
}
Commands::List { verbose } => {
list::handle(verbose, database_dir)
}
Commands::Clean { project, all } => {
clean::handle(project, all, database_dir)
}
}
}