]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
fixed --help-module
authorRuss Combs <rucombs@cisco.com>
Mon, 11 Aug 2014 15:10:20 +0000 (11:10 -0400)
committerRuss Combs <rucombs@cisco.com>
Mon, 11 Aug 2014 15:10:20 +0000 (11:10 -0400)
ChangeLog
src/ips_options/ips_so.cc
src/managers/module_manager.cc
src/managers/module_manager.h

index e69e0b4b7ffe066d324937fc2647a1fd4a691ef7..2d3a65772aa6b625a09786a2613d4081e76c9234 100644 (file)
--- 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)
index 62c63694432c0b0c5b3e7588ebd31d54bc32ce05..1caed7e12d1364db237b382419200eec5b6dc5a7 100644 (file)
@@ -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 }
 };
index 5e50dc6a40687f5f6d48f4da014e0ba2e29bfa9f..85cb0808dc42659812d62859588095f65a235441 100644 (file)
@@ -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;
index 46f0f2cecb56129780552d3a3037c39325b40763..98bfef65e4d18828db03c4fe90c791602e1952a5 100644 (file)
@@ -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);