diff options
Diffstat (limited to 'src/rost.c')
-rw-r--r-- | src/rost.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -91,11 +91,12 @@ static void show_rost_help(const char *name) printf("\n"); - printf("\t-A --algorithm=name\tSelect one of the available algorithms for data: bitmap, acism (default: acsim).\n"); + printf("\t-A --algorithm=NAME\tSelect one of the available algorithms for data: bitmap, acism (default: acsim).\n"); printf("\t-C --check-only\t\tValidate the rule syntax without performing a scan (discard the file/dir argument).\n"); - printf("\t-j --print-json\t\tPrint matching strings in JSON format.\n"); - printf("\t-s --print-strings\tPrint matching strings.\n"); + printf("\t-j --print-json\t\tPrint matching strings in JSON format instead of simple text.\n"); + printf("\t-s --print-strings\tPrint matching strings (default text format only).\n"); printf("\t-S --print-stats\tPrint rules' statistics.\n"); + printf("\t-t --tag=TAG\t\tprint only matching rules tagged as TAG (default text format only).\n"); printf("\t-V --verbosity=level\tSet the log level (0 for all messages, %u for none).\n", LMT_COUNT); printf("\n"); @@ -240,6 +241,7 @@ int main(int argc, char **argv) { "print-json", no_argument, NULL, 'j' }, { "print-strings", no_argument, NULL, 's' }, { "print-stats", no_argument, NULL, 'S' }, + { "tag", required_argument, NULL, 't' }, { "verbosity", required_argument, NULL, 'V' }, { NULL, 0, NULL, 0 } }; @@ -260,7 +262,7 @@ int main(int argc, char **argv) while (true) { - ret = getopt_long(argc, argv, "hvA:CjsSV:", long_options, &index); + ret = getopt_long(argc, argv, "hvA:CjsSt:V:", long_options, &index); if (ret == -1) break; switch (ret) @@ -299,6 +301,10 @@ int main(int argc, char **argv) g_scan_options_set_print_stats(options, true); break; + case 't': + g_scan_options_select_tag(options, optarg); + break; + case 'V': verbosity = strtoul(optarg, NULL, 10); break; @@ -310,7 +316,6 @@ int main(int argc, char **argv) if ((check_only && (optind + 0) != argc && (optind + 1) != argc) || (!check_only && (optind + 1) != argc && (optind + 2) != argc)) { - printf("failed: check=%d optind=%d argc=%d\n", check_only, optind, argc); show_rost_help(argv[0]); goto done; } |