changeset 2593:81f45b2fa118

Revert back to -m/-n.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 30 Dec 2022 10:35:52 +0200
parents 70b589a22495
children 669b71e8b868
files tools/fanalyze.c
diffstat 1 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/tools/fanalyze.c	Fri Dec 30 10:24:20 2022 +0200
+++ b/tools/fanalyze.c	Fri Dec 30 10:35:52 2022 +0200
@@ -143,7 +143,7 @@
     FA_ANALYZE,
     FA_GREP,
     FA_OFFSET,
-    FA_DIFF,
+    FA_MATCH,
 };
 
 
@@ -172,8 +172,8 @@
 
     { 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, 'd', "diff"            , "Side-by-side sliding binary diff", OPT_NONE },
-    { 16, 'm', "minmatch"        , "Minimum match sequence length", OPT_ARGREQ },
+    { 14, 'm', "match"           , "Find matching sequences minimum of <M> bytes long", OPT_NONE },
+    { 16, 'n', "minmatch"        , "Minimum match sequence length", OPT_ARGREQ },
 
     { 18, 'O', "offset-mode"     , "Output -o offset list when in grep mode (-g)", OPT_NONE },
 };
@@ -514,7 +514,7 @@
             return argParseGrepValue(optArg, FA_OFFSET) == DMERR_OK;
 
         case 14:
-            setMode = FA_DIFF;
+            setMode = FA_MATCH;
             break;
 
         case 16:
@@ -980,7 +980,7 @@
 
     }
     else
-    if (setMode == FA_DIFF)
+    if (setMode == FA_MATCH)
     {
         //
         // Attempt to find matching sequences of N+
@@ -1050,6 +1050,7 @@
         if (slow)
             dmPrint(0, "\n\n");
 
+        // Sort the matches by file offset
         for (int nmatch = 0; nmatch < ndmSequences; nmatch++)
         {
             DMMatchSeq *seq = &dmSequences[nmatch];
@@ -1058,9 +1059,7 @@
                 dmCompareMatchPlaces);
         }
 
-        //
         // Count number of files
-        //
         for (int nmatch = 0; nmatch < ndmSequences; nmatch++)
         {
             DMMatchSeq *seq = &dmSequences[nmatch];