From: Eric S. Raymond Date: Tue, 2 Sep 2003 07:10:46 +0000 (+0000) Subject: Remove the no-local-duplicates option. X-Git-Tag: 1.0~73 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=0b911f566b22ea3cec25c46890acbca672c438fe;p=comparator.git Remove the no-local-duplicates option. --- diff --git a/report.c b/report.c index 482f189..578640d 100644 --- a/report.c +++ b/report.c @@ -12,8 +12,6 @@ #define min(x, y) ((x < y) ? (x) : (y)) #define max(x, y) ((x > y) ? (x) : (y)) -static int local_duplicates; - struct item { char *file; @@ -310,7 +308,7 @@ static int sametree(const char *s, const char *t) return (sn == tn) && strncmp(s, t, sn); } -struct match_t *reduce_matches(int localdups) +struct match_t *reduce_matches(void) /* assemble list of duplicated hashes */ { static struct match_t dummy; @@ -459,18 +457,13 @@ main(int argc, char *argv[]) int status; struct match_t *hitlist; - while ((status = getopt(argc, argv, "dh")) != EOF) + while ((status = getopt(argc, argv, "h")) != EOF) { switch (status) { - case 'd': - local_duplicates = 1; - break; - case 'h': default: - fprintf(stderr,"usage: shredtree [-d] hashfile...\n"); - fprintf(stderr," -d = remove local duplicates.\n"); + fprintf(stderr,"usage: shredtree hashfile...\n"); fprintf(stderr," -h = help (display this message).\n"); exit(0); } @@ -489,7 +482,7 @@ main(int argc, char *argv[]) printf("%d: %s:%d:%d (%02x%02x)\n", np-obarray, np->file, np->hash.start, np->hash.end, np->hash.hash[0], np->hash.hash[1]); #endif /* ODEBUG */ - hitlist = reduce_matches(local_duplicates); + hitlist = reduce_matches(); report_time("Reduction done"); puts("#SHIF-B 1.0"); diff --git a/shredcompare.py b/shredcompare.py index 7bce990..a3d3e0c 100755 --- a/shredcompare.py +++ b/shredcompare.py @@ -135,15 +135,11 @@ if __name__ == '__main__': try: (optlist, args) = getopt.getopt(sys.argv[1:], 'd') except getopt.GetoptError: - sys.stderr.write("usage: shredcompare [-h] [-d] file\n") + sys.stderr.write("usage: shredcompare [-h] file\n") sys.exit(2) - local_duplicates = True for (opt, val) in optlist: - if opt == '-d': - local_duplicates = False - elif opt == '-h': + if opt == '-h': sys.stderr.write("usage: shredcompare [-d] file\n"); - sys.stderr.write(" -d = discard local duplicates.\n"); sys.stderr.write(" -h = help (display this message).\n"); sys.exit(0);