Skip to content

Commit

Permalink
Implement -m for json output.
Browse files Browse the repository at this point in the history
  • Loading branch information
wxsBSD committed Aug 1, 2024
1 parent 1ca78b3 commit 9629b5d
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions cli/src/commands/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ fn print_rules_as_json(
output: &Sender<Message>,
) {
let print_namespace = args.get_flag("print-namespace");
let print_meta = args.get_flag("print-meta");
let print_strings = args.get_flag("print-strings");
let print_strings_limit = args.get_one::<usize>("print-strings-limit");

Expand All @@ -378,14 +379,9 @@ fn print_rules_as_json(
})
};

/*
output
.send(Message::Info(format!(
"{}",
matching_rule.metadata().into_json()
)))
.unwrap();
*/
if print_meta {
json_rule["meta"] = matching_rule.metadata().into_json();
}

if print_strings || print_strings_limit.is_some() {
let limit = print_strings_limit.unwrap_or(&STRINGS_LIMIT);
Expand Down

0 comments on commit 9629b5d

Please sign in to comment.