diff --git a/README.md b/README.md index d5d1868..72f1135 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,22 @@ # dsearch -File duplicates scanner. Usage example: -``` bash -dsearch -d /home/user/docs +File duplicates scanner. +## Usage ``` +dsearch [Options] +Options: + -h,--help Print this help message and exit + -d,--directory TEXT Root directory for search; default: cwd + -a,--algorithms TEXT ... Search algorithms: name, size, head, hash; default: 'name size head hash' + name - compares file name + size - compares file size + head - compares only first 4096 bytes file block + hash - compares whole file hashes +``` +Example: +``` bash +dsearch -d /path/to/root -a 'name size' +``` ## Info * Contains docker file for build evironment. * catch2 https://github.com/catchorg/Catch2 diff --git a/cli/main.cpp b/cli/main.cpp index 7176f71..895c989 100644 --- a/cli/main.cpp +++ b/cli/main.cpp @@ -27,8 +27,8 @@ int main(int argc, char **argv) { std::string directory = std::filesystem::current_path().string(); std::vector algorithms = standardAlgorithms; - app.add_option("-d,--directory", directory); - app.add_option("-als,--algorithms", algorithms); + app.add_option("-d,--directory", directory, "Root directory for search; default: cwd"); + app.add_option("-a,--algorithms", algorithms, "Search algorithms: name, size, head, hash; default: 'name size head hash'"); CLI11_PARSE(app, argc, argv);