#define min(x, y) ((x < y) ? (x) : (y))
#define max(x, y) ((x > y) ? (x) : (y))
-static int local_duplicates;
-
struct item
{
char *file;
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;
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);
}
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");
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);