import argparse
from .pdf_sorter import sort_pdfs
from .photo_sorter import sort_photos
from .dmg_cleaner import delete_dmg

def main():
    parser = argparse.ArgumentParser(
        prog="organizer",
        description="Mac Downloads Organizer CLI"
    )

    subparsers = parser.add_subparsers(dest="command")

    subparsers.add_parser("sort-pdf")
    subparsers.add_parser("sort-photos")
    subparsers.add_parser("delete-dmg")
    subparsers.add_parser("clean-all")

    args = parser.parse_args()

    if args.command == "sort-pdf":
        sort_pdfs()

    elif args.command == "sort-photos":
        sort_photos()

    elif args.command == "delete-dmg":
        delete_dmg()

    elif args.command == "clean-all":
        sort_pdfs()
        sort_photos()
        delete_dmg()

    else:
        parser.print_help()
