X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=finddup.c;h=e881fff9ba9f18527d0314c2cdf8765308bb6ab5;hb=ad1b1b341fdfabc708e174cbc29006988b1df342;hp=8f2b6c9e07396f279d8fd343b52c216da7acf911;hpb=ab7b6e26f35ac1dfc88d9bf1e09dd289a30ea782;p=finddup.git diff --git a/finddup.c b/finddup.c index 8f2b6c9..e881fff 100644 --- a/finddup.c +++ b/finddup.c @@ -23,7 +23,7 @@ * */ -#define VERSION_NUMBER "0.9" +#define VERSION_NUMBER "1.0" #define _BSD_SOURCE @@ -503,9 +503,9 @@ void start(const char *dirname1, const char *dirname2) { } void usage(FILE *out) { - fprintf(out, "Usage: finddup [OPTION]... DIR1 [[and:|not:]DIR2]\n"); + fprintf(out, "Usage: finddup [OPTION]... [DIR1 [[and:|not:]DIR2]]\n"); fprintf(out, "Version %s (%s)\n", VERSION_NUMBER, UNAME); - 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. The and: prefix is the default and should be used only if you have a directory starting with 'not:'\n"); + fprintf(out, "Without DIR2, lists duplicated files found in DIR1, or the current directory if DIR1 is not provided. With DIR2, lists files common to both directories. With the not: prefix, lists files found in DIR1 which do not exist in DIR2. The and: prefix is the default and should be used only if you have a directory starting with 'not:'\n"); fprintf(out, "\n"); /* 01234567890123456789012345678901234567890123456789012345678901234567890123456789*/ fprintf(out, " -h, --help show this help\n"); @@ -594,6 +594,9 @@ int main(int argc, char **argv) { } else if(optind + 1 == argc) { same_inodes_are_different = 1; start(argv[optind], 0); + } else if(optind == argc) { + same_inodes_are_different = 1; + start(".", 0); } else { usage(stderr); exit(EXIT_FAILURE);