X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=finddup.git;a=blobdiff_plain;f=finddup.c;h=b8a703aa6d85afd0ca1f5eb38f66d5de317fc71c;hp=8f2b6c9e07396f279d8fd343b52c216da7acf911;hb=8c988a4aca00501c9a9d53f4ff228dcb0bce0acb;hpb=2e218d38854bc5934f3935bc7aa6eab598770bdb diff --git a/finddup.c b/finddup.c index 8f2b6c9..b8a703a 100644 --- a/finddup.c +++ b/finddup.c @@ -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);