mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-09 19:45:13 +02:00
- Implement `max_file_size_mb` to restrict files for scanning based on size. - Refactor `high_only` handling to modify `min_severity` in `Config`. - Update `ScannerConfig` to use `Option<u64>` for optional size limits. - Remove redundant `high_only` parameter from `scan::handle` function. - Improve batch processing in `walk` for efficient file scanning.
32 lines
No EOL
920 B
Rust
32 lines
No EOL
920 B
Rust
pub mod scan;
|
|
pub mod index;
|
|
pub mod list;
|
|
pub mod clean;
|
|
|
|
use crate::cli::Commands;
|
|
use std::path::Path;
|
|
use crate::patterns::Severity;
|
|
use crate::utils::config::Config;
|
|
|
|
pub fn handle_command(
|
|
command: Commands,
|
|
database_dir: &Path,
|
|
config: &mut Config
|
|
) -> Result<(), Box<dyn std::error::Error>> {
|
|
match command {
|
|
Commands::Scan { path, no_index, rebuild_index, format, high_only } => {
|
|
if high_only { config.scanner.min_severity = Severity::High };
|
|
|
|
scan::handle(&path, no_index, rebuild_index, format, database_dir, config)
|
|
}
|
|
Commands::Index { action } => {
|
|
index::handle(action, database_dir, config)
|
|
}
|
|
Commands::List { verbose } => {
|
|
list::handle(verbose, database_dir)
|
|
}
|
|
Commands::Clean { project, all } => {
|
|
clean::handle(project, all, database_dir)
|
|
}
|
|
}
|
|
} |