<arg choice='opt'>-c</arg>
<arg choice='opt'>-C</arg>
<arg choice='opt'>-d <replaceable>dir</replaceable></arg>
+ <arg choice='opt'>-m <replaceable>size</replaceable></arg>
<arg choice='opt'>-o <replaceable>file</replaceable></arg>
<arg choice='opt'>-r</arg>
<arg choice='opt'>-s <replaceable>shredsize</replaceable></arg>
<sbr/>
<command>filterator</command>
<arg choice='opt'>-d <replaceable>dir</replaceable></arg>
+ <arg choice='opt'>-m <replaceable>minsize</replaceable></arg>
<arg choice='opt'>-n</arg>
- <arg choice='opt'>-s <replaceable>minsize</replaceable></arg>
<arg choice='opt'>-x</arg>
</cmdsynopsis>
<para>The <option>-o</option> directs output to a specified file. This
may be used with <option>-c</option> to override the normal
<filename>.scf</filename> convention, or simply as an alternative
-to ouput redirection when generating a final report.</para>
+to ouput redirection when generating a final report. One advantage
+of <option>-o</option> is that the program won't create the output
+file until it is ready to write; thus, unlike shell redirects, it
+won't leave an empty file lying aeound if it aborts early.</para>
<para>The <option>-d</option> option changes current directory to the
specified tree before walking down each argument path to generate
correspondingly noisier output. Larger ones will suppress both noise
and small similarities.</para>
+<para>The <option>-m</option> option sets the minimum-sized span
+of lines that will be output. By default this is zero; setting it
+to a value higher than the shred size will eliminate a lot of junk
+from the report. These are two separate parameters because shred size
+controls how likely common segments are to not get recognized because
+of unshared things near them, while minimum span size defines the
+smallest features we want to see in the output report.</para>
+
<para>The <option>-w</option> causes all whitespace in the file
(including blank lines) to be ignored for comparison purposes (line
numbers in the output report will nevertheless be correct).</para>
<para>The <option>-n</option> suppresses noise filtering. The
<option>-d</option> acts as it does for
-<application>comparator</application>. The <option>-s</option> option
+<application>comparator</application>. The <option>-m</option> option
sets the minimum size of overlap to be reported. Setting this to a
slightly larger number than the <application>comparator</application>
shred size is a useful way to filter out spurious matches; thus, while
#include <time.h>
#include "shred.h"
-int verbose = 0, debug = 0;
+int verbose, debug, minsize;
struct scf_t
{
static void usage(void)
{
- fprintf(stderr,"usage: comparator [-c] [-C] [-d dir ] [-r] [-o file] [-s shredsize] [-v] [-w] [-x] path...\n");
+ fprintf(stderr,"usage: comparator [-c] [-C] [-d dir ] [-m minsize] [-r] [-o file] [-s shredsize] [-v] [-w] [-x] path...\n");
fprintf(stderr," -c = generate SCF files\n");
fprintf(stderr," -C = apply C normalizations\n");
fprintf(stderr," -d dir = change directory before digesting.\n");
+ fprintf(stderr," -m size = set minimum size of span to be output.\n");
fprintf(stderr," -o file = write to the specified file.\n");
fprintf(stderr," -r = renove comments\n");
fprintf(stderr," -s size = set shred size (default %d)\n", shredsize);
compile_only = file_only = 0;
dir = outfile = NULL;
- while ((status = getopt(argc, argv, "cCd:ho:rs:vwx")) != EOF)
+ while ((status = getopt(argc, argv, "cCd:hm:o:rs:vwx")) != EOF)
{
switch (status)
{
dir = optarg;
break;
+ case 'm':
+ minsize = atoi(optarg);
+ break;
+
case 'o':
outfile = optarg;
break;