From b1122ce4f579824cd5182f5bdd1f5c780c652d3b Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Mon, 8 Mar 2010 08:17:18 +0100 Subject: [PATCH] Changed the syntax for negation from ^ to not: --- finddup.1 | 15 +++++---------- finddup.c | 8 ++++---- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/finddup.1 b/finddup.1 index 3ae9a42..d0c0eba 100644 --- a/finddup.1 +++ b/finddup.1 @@ -10,19 +10,14 @@ finddup \- Find files common to two directories (or not) .SH "SYNOPSIS" -\fBfinddup\fP [OPTION]... DIR1 [[^]DIR2] +\fBfinddup\fP [OPTION]... DIR1 [[not:]DIR2] .SH "DESCRIPTION" -\fBfinddup\fP is a command line utility to find duplicate files, files -common to two directories or files existing in one directory and not -in another one. - -With a single directory argument, prints the duplicate files found in -it. With two directories, prints the files common to both. - -If the second directory name starts with a ^, prints the files -existing in DIR1 which do not exist in DIR2. +With a single directory argument, \fBfinddup\fP prints the duplicate +files found in it. With two directories, it prints either the files +common to both DIR1 and DIR2, or with the not: prefix, the ones +present in DIR1 and not in DIR2. .SH "OPTIONS" .TP diff --git a/finddup.c b/finddup.c index 9a6e6be..91079de 100644 --- a/finddup.c +++ b/finddup.c @@ -221,9 +221,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 +272,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 duplicate 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"); -- 2.20.1