X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=finddup.c;h=8d6e67af255088462aa88a7a9a548d8e9eba768d;hb=da07c4f78dce0021ed889ea0db818cb55d96ceed;hp=9a6e6be0dec6009d4d012f5b25c0a7efd1dec613;hpb=2eac88f904b6f292a65d909e40e48eae62e3f8ac;p=finddup.git diff --git a/finddup.c b/finddup.c index 9a6e6be..8d6e67a 100644 --- a/finddup.c +++ b/finddup.c @@ -1,7 +1,8 @@ /* - * finddup is a simple utility to display the files and directories - * according to their total disk occupancy. + * finddup is a simple utility find duplicated files, files common to + * several directories, or files present in one directory and not in + * another one. * * Copyright (c) 2010 Francois Fleuret * Written by Francois Fleuret @@ -221,9 +222,9 @@ void start(const char *dirname1, const char *dirname2) { struct file_with_size *node1, *node2; int not_in, found; - if(dirname2[0] == '^') { + if(strncmp(dirname2, "not:", 4) == 0) { not_in = 1; - dirname2++; + dirname2 += 4; } else { not_in = 0; } @@ -272,9 +273,9 @@ void start(const char *dirname1, const char *dirname2) { } void print_help(FILE *out) { - fprintf(out, "Usage: finddup [OPTION]... DIR1 [[^]DIR2]\n"); + fprintf(out, "Usage: finddup [OPTION]... DIR1 [[not:]DIR2]\n"); fprintf(out, "Version %s (%s)\n", VERSION_NUMBER, UNAME); - fprintf(out, "Without DIR2, lists duplicated files in DIR1. With DIR2, list files common to both directories. With DIR2 starting with a ^, list files found in DIR1 which do not exist in DIR2.\n"); + fprintf(out, "Without DIR2, lists duplicated files found in DIR1. With DIR2, lists files common to both directories. With the not: prefix, lists files found in DIR1 which do not exist in DIR2.\n"); fprintf(out, "\n"); fprintf(out, " -h show this help.\n"); fprintf(out, " -r show the real file paths.\n");