Skip to content

Commit

Permalink
Implement --pring-namespace commad-line argument
Browse files Browse the repository at this point in the history
  • Loading branch information
plusvic committed Nov 21, 2014
1 parent c637143 commit 3234c4b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions yara.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ int show_specified_tags = FALSE;
int show_specified_rules = FALSE;
int show_strings = FALSE;
int show_meta = FALSE;
int show_namespace = FALSE;
int ignore_warnings = FALSE;
int fast_scan = FALSE;
int negate = FALSE;
Expand Down Expand Up @@ -127,6 +128,9 @@ struct argparse_option options[] =
OPT_BOOLEAN('s', "print-strings", &show_strings,
"print matching strings"),

OPT_BOOLEAN('e', "print-namespace", &show_namespace,
"print rules' namespace"),

OPT_INTEGER('p', "threads", &threads,
"use the specified number of threads to scan a directory", "<number>"),

Expand Down Expand Up @@ -491,6 +495,10 @@ int handle_message(int message, YR_RULE* rule, void* data)
if (show)
{
mutex_lock(&output_mutex);

if (show_namespace)
printf("%s:", rule->ns->name);

printf("%s ", rule->identifier);

if (show_tags)
Expand Down

0 comments on commit 3234c4b

Please sign in to comment.