diff tools/fanalyze.c @ 2408:60e119262c67

Option index re-ordering cleanup work.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 13 Jan 2020 21:21:25 +0200
parents b7cd5dd0b82e
children bc05bcfc4598
line wrap: on
line diff
--- a/tools/fanalyze.c	Mon Jan 13 21:16:57 2020 +0200
+++ b/tools/fanalyze.c	Mon Jan 13 21:21:25 2020 +0200
@@ -164,12 +164,13 @@
  */
 static const DMOptArg optList[] =
 {
-    {  0, '?', "help",        "Show this help", OPT_NONE },
-    {  1, 'v', "verbose",     "Be more verbose", OPT_NONE },
-    {  2, 'g', "grep",        "Binary grep <val>[,<val2>...][:<le|be>[8|16|32]]", OPT_ARGREQ },
-    {  3, 'o', "offset",      "Show data in offset <offs>[,<offs2>...][:<le|be>[8|16|32][d|x]]", OPT_ARGREQ },
-    {  4, 'm', "match",       "Find matching sequences minimum of <n> bytes long", OPT_NONE },
-    {  5, 'n', "minmatch",    "Minimum match sequence length", OPT_ARGREQ },
+    {  0, '?', "help"            , "Show this help", OPT_NONE },
+    {  2, 'v', "verbose"         , "Be more verbose", OPT_NONE },
+
+    { 10, 'g', "grep"            , "Binary grep <val>[,<val2>...][:<le|be>[8|16|32]]", OPT_ARGREQ },
+    { 12, 'o', "offset"          , "Show data in offset <offs>[,<offs2>...][:<le|be>[8|16|32][d|x]]", OPT_ARGREQ },
+    { 14, 'm', "match"           , "Find matching sequences minimum of <n> bytes long", OPT_NONE },
+    { 16, 'n', "minmatch"        , "Minimum match sequence length", OPT_ARGREQ },
 };
 
 static const int optListN = sizeof(optList) / sizeof(optList[0]);
@@ -483,8 +484,6 @@
 
 BOOL argHandleOpt(const int optN, char *optArg, char *currArg)
 {
-    (void) optArg;
-
     switch (optN)
     {
         case 0:
@@ -496,17 +495,17 @@
             dmVerbosity++;
             break;
 
-        case 2:
+        case 10:
             return argParseGrepValue(optArg, FA_GREP) == DMERR_OK;
 
-        case 3:
+        case 12:
             return argParseGrepValue(optArg, FA_OFFSET) == DMERR_OK;
 
-        case 4:
+        case 14:
             setMode = FA_MATCHES;
             break;
 
-        case 5:
+        case 16:
             optMinMatchLen = atoi(optArg);
             if (optMinMatchLen < 2 || optMinMatchLen > 16*1024)
             {