import click

from pycage.helpers import delete_files, print_error


@click.group(help="commands to remove specified files")
def clean() -> None:
    pass


@click.command(help="removes all pre-compiled byte code files in the distribution")
def precompiled() -> None:
    try:
        delete_files(r"**/*.pyc")
    except Exception as err:
        print_error(err)


@click.command(help="removes all sensitive distribution data")
def dist_info() -> None:
    try:
        delete_files(r"**/*url.json")
    except Exception as err:
        print_error(err)


clean.add_command(precompiled)
clean.add_command(dist_info)
