From 1384a5451fa968eb72dc2d77dfba70b0f264838e Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Tue, 14 Nov 2023 12:17:21 +0100 Subject: [PATCH] Updated arguments --- main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index a598731..e77b376 100644 --- a/main.py +++ b/main.py @@ -37,7 +37,7 @@ def handle_modification(files, modification, mode, apply_to): original_file = files[0] # Keep the first file for duplicate_file in files[1:]: # Iterate over remaining files if duplicate_file.startswith(tuple(apply_to)): - if mode == 'preview': + if mode == 'preview' and modification != 'show': print(f"Would perform {modification} on {duplicate_file}") elif mode == 'act': handle_file_modification(original_file, duplicate_file, modification) @@ -58,13 +58,13 @@ def main(args): for file_hash, files in duplicates.items(): print(f"Duplicate files for hash {file_hash}:") - [print(file) for file in files if file.startswith(tuple(apply_to))] + [print(file) for file in files if file.startswith(tuple(directories))] handle_modification(files, args.modification, args.mode, apply_to) if __name__ == "__main__": parser = argparse.ArgumentParser(description="Find and handle duplicate files.") parser.add_argument('directories', nargs='*', help="Directories to scan for duplicates.") - parser.add_argument('--apply-to', nargs='*', help="Directories to apply modifications to.") + parser.add_argument('--apply-to', nargs='*', help="Filter directories to apply modifications to.") parser.add_argument('--modification', choices=['delete', 'hardlink', 'symlink', 'show'], default='show', help="Modification to perform on duplicates.") parser.add_argument('--mode', choices=['act', 'preview', 'interactive'], default='preview', help="How to apply the modifications.")