From: Russ Combs Date: Mon, 11 Aug 2014 15:10:20 +0000 (-0400) Subject: fixed --help-module X-Git-Tag: 3.0.0-233~1426^2~20 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d0ab780321b4cf64299b7b9dca43b3eceafa9bfa;p=thirdparty%2Fsnort3.git fixed --help-module --- diff --git a/ChangeLog b/ChangeLog index e69e0b4b7..2d3a65772 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ -- fix up rule loading -- fixed so rule parsing -- added pcre jit +-- fixed --help-module to use exact match on module for params instead of + prefix 110 -- converted rule meta options to ips options (w/o eval) diff --git a/src/ips_options/ips_so.cc b/src/ips_options/ips_so.cc index 62c636944..1caed7e12 100644 --- a/src/ips_options/ips_so.cc +++ b/src/ips_options/ips_so.cc @@ -112,7 +112,7 @@ int SoOption::eval(Cursor&, Packet* p) static const Parameter so_params[] = { { "~func", Parameter::PT_STRING, nullptr, nullptr, - "name of function to call" }, + "name of eval function" }, { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr } }; diff --git a/src/managers/module_manager.cc b/src/managers/module_manager.cc index 5e50dc6a4..85cb0808d 100644 --- a/src/managers/module_manager.cc +++ b/src/managers/module_manager.cc @@ -516,7 +516,7 @@ void ModuleManager::show_module(const char* name) if ( p->type < Parameter::PT_MAX ) { cout << endl << "Configuration: " << endl << endl; - show_configs(name); + show_configs(name, true); } } @@ -540,7 +540,7 @@ void ModuleManager::show_module(const char* name) } } -void ModuleManager::show_configs(const char* pfx) +void ModuleManager::show_configs(const char* pfx, bool exact) { s_modules.sort(comp_mods); @@ -549,6 +549,9 @@ void ModuleManager::show_configs(const char* pfx) Module* m = p->mod; string s; + if ( exact && strcmp(m->get_name(), pfx) ) + continue; + if ( m->is_list() ) { s = m->name; diff --git a/src/managers/module_manager.h b/src/managers/module_manager.h index 46f0f2cec..98bfef65e 100644 --- a/src/managers/module_manager.h +++ b/src/managers/module_manager.h @@ -39,7 +39,7 @@ public: static void dump_modules(); static void show_module(const char*); - static void show_configs(const char* = nullptr); + static void show_configs(const char* = nullptr, bool exact = false); static void show_commands(const char* = nullptr); static void show_gids(const char* = nullptr); static void show_pegs(const char* = nullptr);