Skip to content

Commit

Permalink
main: add support for -r
Browse files Browse the repository at this point in the history
  • Loading branch information
aerickson committed Jul 24, 2024
1 parent bc631b3 commit fb2f4bc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion directory_cleaner/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def get_version_from_pyproject():

def main():
parser = argparse.ArgumentParser(
description="Remove all files and directories not in an exception list (in a specfic directory).",
description="Delete items in a directory while excluding certain items.",
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog=textwrap.dedent(
"""\
Expand Down Expand Up @@ -77,6 +77,13 @@ def main():
action="store_true",
help="Print debug information.",
)
parser.add_argument(
"--remove-empty-directories",
"-r",
dest="remove_empty_directories",
action="store_true",
help="Remove empty directories.",
)
parser.add_argument(
"--version", action="version", version=get_version_from_pyproject()
)
Expand All @@ -93,6 +100,7 @@ def main():
config["exclusion_patterns"],
dry_run=args.dry_run,
debug_mode=args.verbose,
remove_empty_directories=args.remove_empty_directories,
)

# Clean the directory
Expand Down

0 comments on commit fb2f4bc

Please sign in to comment.