]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
fixed --help etc.
authorRuss Combs <rucombs@cisco.com>
Fri, 10 Oct 2014 21:19:59 +0000 (17:19 -0400)
committerRuss Combs <rucombs@cisco.com>
Fri, 10 Oct 2014 21:19:59 +0000 (17:19 -0400)
ChangeLog
src/main/help.cc
src/main/snort_module.cc

index e3c07805d088a94a297fc1b12bc842e1691d53c9..449304265dea976f3e44f414c9ff61556b27ef80 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -27,6 +27,7 @@
 -- reworked manual again to include terms and lists of modules and plugins
 -- added non-Lua error message
 -- updated .gitignore and sorted it
+-- fixed --help, etc.
 
 123
 -- refactored documentation
index c9d3cd4006b4f9fccc5c1bcf17ddd7046d151130..955431e033e8c97cae4ee14b588e8194567f49c5 100644 (file)
@@ -51,7 +51,7 @@ static const char* snort_help =
 "\n"
 "Snort has several options to get more help:\n"
 "\n"
-"-? list command line options\n"
+"-? list command line options (same as --help)\n"
 "--help this overview of help\n"
 "--help-commands [<module prefix>] output matching commands\n"
 "--help-config [<module prefix>] output matching config options\n"
@@ -63,9 +63,9 @@ static const char* snort_help =
 "--list-buffers output available inspection buffers\n"
 "--list-builtin [<module prefix>] output matching builtin rules\n"
 "--list-gids [<module prefix>] output matching generators\n"
-"--list-modules list all known modules\n"
+"--list-modules [<module type>] list all known modules\n"
 "--list-plugins list all known modules\n"
-"--markup output help in asciidoc compatible format\n"
+"--show-plugins list module and plugin versions\n"
 "\n"
 "--help* and --list* options preempt other processing so should be last on the\n"
 "command line since any following options are ignored.  To ensure options like\n"
@@ -101,7 +101,11 @@ void help_args(const char* pfx)
 
     while ( p->name )
     {
-        if ( p->help && (!n || !strncasecmp(p->name, pfx, n)) )
+        const char* name = p->name;
+        while ( *name == '-' )
+            name++;
+
+        if ( p->help && (!n || !strncasecmp(name, pfx, n)) )
         {
             cout << Markup::item();
             cout << Markup::emphasis_on();
index 91ac2a07b495085c30b51c2e16b2f70037b6dba1..544668f28f243d8d9e017f275bde325a6f9f017a 100644 (file)
@@ -75,8 +75,8 @@ static const Command snort_cmds[] =
 
 static const Parameter s_params[] =
 {
-    { "-?", Parameter::PT_IMPLIED, nullptr, nullptr,
-      "list command line options (same as --help)" },
+    { "-?", Parameter::PT_STRING, "(optional)", nullptr,
+      "<option prefix> output matching command line option quick help (same as --help-options)" },
 
     { "-A", Parameter::PT_STRING, nullptr, nullptr, 
       "<mode> set alert mode: none, cmg, or alert_*" },
@@ -236,10 +236,7 @@ static const Parameter s_params[] =
       "enable Inline-Test Mode Operation" },
 
     { "--help", Parameter::PT_IMPLIED, nullptr, nullptr,
-      "list command line options (same as -?)" },
-
-    { "--help!", Parameter::PT_IMPLIED, nullptr, nullptr,
-      "overview of help" },
+      "list command line options" },
 
     { "--help-commands", Parameter::PT_STRING, "(optional)", nullptr,
       "[<module prefix>] output matching commands" },
@@ -257,7 +254,7 @@ static const Parameter s_params[] =
       "list all available plugins with brief help" },
 
     { "--help-options", Parameter::PT_STRING, "(optional)", nullptr,
-      "<option prefix> output matching command line option quick help" },
+      "<option prefix> output matching command line option quick help (same as -?)" },
 
     { "--help-signals", Parameter::PT_IMPLIED, nullptr, nullptr,
       "dump available control signals" },