add default limit
This commit is contained in:
parent
b754643db2
commit
945bef4f59
1 changed files with 2 additions and 2 deletions
|
@ -90,7 +90,7 @@ class find_duplicate_files:
|
||||||
files = dict()
|
files = dict()
|
||||||
try:
|
try:
|
||||||
for file in os.scandir(path):
|
for file in os.scandir(path):
|
||||||
if len(files) > self.limit:
|
if self.limit > 0 and len(files) > self.limit:
|
||||||
self._log.debug(f"Limit of {self.limit} passed ({len(files)})")
|
self._log.debug(f"Limit of {self.limit} passed ({len(files)})")
|
||||||
break
|
break
|
||||||
if not file.name.startswith('.'):
|
if not file.name.startswith('.'):
|
||||||
|
@ -159,7 +159,7 @@ class find_duplicate_files:
|
||||||
@click.option('--first-directory', '-f', required=True, help='First directory to find files AND TO DELETE FILES FROM!!!')
|
@click.option('--first-directory', '-f', required=True, help='First directory to find files AND TO DELETE FILES FROM!!!')
|
||||||
@click.option('--second-directory', '-s', required=True, help='Second directory to find files')
|
@click.option('--second-directory', '-s', required=True, help='Second directory to find files')
|
||||||
@click.option('--exclude', '-e', multiple=True, help='Regular expression pattern to exclude from files and directories.')
|
@click.option('--exclude', '-e', multiple=True, help='Regular expression pattern to exclude from files and directories.')
|
||||||
@click.option('--limit', '-l', type=int, default=None, help='Limit to a certain number of files to check.')
|
@click.option('--limit', '-l', default=0, type=int, default=None, help='Limit to a certain number of files to check.')
|
||||||
@click_config_file.configuration_option()
|
@click_config_file.configuration_option()
|
||||||
def __main__(debug_level, log_file, dummy, first_directory, second_directory, exclude, limit):
|
def __main__(debug_level, log_file, dummy, first_directory, second_directory, exclude, limit):
|
||||||
return find_duplicate_files(debug_level, log_file, dummy, first_directory, second_directory, exclude, limit)
|
return find_duplicate_files(debug_level, log_file, dummy, first_directory, second_directory, exclude, limit)
|
||||||
|
|
Loading…
Reference in a new issue