changed hidden rule count output when excluded and noisy and rule parsing error count 0

This commit is contained in:
DustInDark
2022-06-24 23:02:24 +09:00
parent 3053a3579a
commit 4da7b17784

View File

@@ -374,6 +374,7 @@ impl Detection {
let args = &configs::CONFIG.read().unwrap().args; let args = &configs::CONFIG.read().unwrap().args;
sorted_ld_rc.into_iter().for_each(|(key, value)| { sorted_ld_rc.into_iter().for_each(|(key, value)| {
if value != &0_u128 {
let disable_flag = if key == "noisy" && !args.enable_noisy_rules { let disable_flag = if key == "noisy" && !args.enable_noisy_rules {
" (Disabled)" " (Disabled)"
} else { } else {
@@ -386,13 +387,16 @@ impl Detection {
value, value,
disable_flag, disable_flag,
); );
}
}); });
if err_rc != &0_u128 {
write_color_buffer( write_color_buffer(
BufferWriter::stdout(ColorChoice::Always), BufferWriter::stdout(ColorChoice::Always),
Some(Color::Red), Some(Color::Red),
&format!("Rule parsing errors: {}", err_rc), &format!("Rule parsing errors: {}", err_rc),
) )
.ok(); .ok();
}
println!(); println!();
let mut sorted_st_rc: Vec<(&String, &u128)> = st_rc.iter().collect(); let mut sorted_st_rc: Vec<(&String, &u128)> = st_rc.iter().collect();