*
*/
+#define VERSION_NUMBER "0.5"
+
#define _BSD_SOURCE
#include <sys/types.h>
file_list_delete(list2);
}
+void print_help(FILE *out) {
+ fprintf(out, "Usage: finddup [OPTION]... DIR1 [[^]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, "\n");
+ fprintf(out, " -h show this help.\n");
+ fprintf(out, " -r show the real file paths.\n");
+ fprintf(out, "\n");
+ fprintf(out, "Report bugs and comments to <francois@fleuret.org>\n");
+}
+
/**********************************************************************/
int main(int argc, char **argv) {
switch (c) {
case 'h':
- printf("Usage: finddup [OPTION]... [FILE]...\n");
- printf("Report bugs and comments to <francois@fleuret.org>\n");
+ print_help(stdout);
exit(EXIT_SUCCESS);
break;
} else if(optind < argc) {
start(argv[optind], argv[optind]);
} else {
- fprintf(stderr, "%s [OPTIONS] <dir1> [[^]<dir2>]\n", argv[0]);
+ print_help(stderr);
exit(EXIT_FAILURE);
}