mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-30 20:39:39 +02:00
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:
commit
ab5558f537
16 changed files with 2187 additions and 0 deletions
29
src/commands/mod.rs
Normal file
29
src/commands/mod.rs
Normal 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)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue