mirror of
https://github.com/elicpeter/nyx.git
synced 2026-07-06 20:42:10 +02:00
Refactor codebase for consistent indentation and formatting
- Standardized spacing and indentation across multiple modules for improved readability. - Reorganized `patterns` and `utils` imports for consistency. - Updated `NyxError` and `NyxResult` related implementations to maintain consistent formatting. - Enhanced readability in AST patterns for better clarity and maintainability.
This commit is contained in:
parent
b3870997d7
commit
14a549ac39
26 changed files with 1314 additions and 1221 deletions
|
|
@ -1,33 +1,35 @@
|
|||
pub mod scan;
|
||||
pub mod clean;
|
||||
pub mod index;
|
||||
pub mod list;
|
||||
pub mod clean;
|
||||
pub mod scan;
|
||||
|
||||
use crate::cli::Commands;
|
||||
use std::path::Path;
|
||||
use crate::errors::NyxResult;
|
||||
use crate::patterns::Severity;
|
||||
use crate::utils::config::Config;
|
||||
use std::path::Path;
|
||||
|
||||
pub fn handle_command(
|
||||
command: Commands,
|
||||
database_dir: &Path,
|
||||
config: &mut Config
|
||||
config: &mut Config,
|
||||
) -> NyxResult<()> {
|
||||
match command {
|
||||
Commands::Scan { path, no_index, rebuild_index, format, high_only } => {
|
||||
if high_only { config.scanner.min_severity = Severity::High };
|
||||
|
||||
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)
|
||||
}
|
||||
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),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue