"""
ABSFUYU CLI
-----------
Misc

Version: 6.8.0
Date updated: 26/04/2026 (dd/mm/yyyy)
"""

# Module Package
# ---------------------------------------------------------------------------
__all__ = ["misc_group"]


# Library
# ---------------------------------------------------------------------------
import click

from absfuyu.fun.numerology import NumerologyCalculator


# CLI
# ---------------------------------------------------------------------------
@click.command(name="num")
@click.argument("name", type=str)
@click.argument("birthdate", type=str)
def cal_numerology(name: str, birthdate: str) -> None:
    """Calculate numerology"""
    e = NumerologyCalculator(name, birthdate)
    click.echo(e.calulate().to_report())


@click.command(name="e")
@click.argument("dir_path", type=str)
@click.argument("passwd", type=str)
@click.option(
    "--salt",
    "-s",
    "salt",
    type=str,
    default=None,
    show_default=True,
    help="Salt (if any)",
)
@click.option(
    "--delete-when-done",
    "-d",
    "delete_when_complete",
    type=bool,
    default=False,
    is_flag=True,
    show_default=True,
    help="Delete files when completed",
)
def rclone_encrypt(dir_path: str, passwd: str, salt: str, delete_when_complete: bool) -> None:
    """Encrypt Rclone folder"""
    from absfuyu.extra.rclone import DirectoryRcloneDEMixin

    e = DirectoryRcloneDEMixin(dir_path)
    e.rclone_encrypt(passwd=passwd, salt=salt, delete_when_complete=delete_when_complete)
    # click.echo()


@click.command(name="d")
@click.argument("dir_path", type=str)
@click.argument("passwd", type=str)
@click.option(
    "--salt",
    "-s",
    "salt",
    type=str,
    default=None,
    show_default=True,
    help="Salt (if any)",
)
@click.option(
    "--delete-when-done",
    "-d",
    "delete_when_complete",
    type=bool,
    default=False,
    is_flag=True,
    show_default=True,
    help="Delete files when completed",
)
def rclone_decrypt(dir_path: str, passwd: str, salt: str, delete_when_complete: bool) -> None:
    """Decrypt Rclone folder"""
    from absfuyu.extra.rclone import DirectoryRcloneDEMixin

    e = DirectoryRcloneDEMixin(dir_path)
    e.rclone_decrypt(passwd=passwd, salt=salt, delete_when_complete=delete_when_complete)
    # click.echo()


###


@click.group(name="rclone")
def rclone_group() -> None:
    """Rclone encrypt decrypt"""
    pass


rclone_group.add_command(rclone_encrypt)
rclone_group.add_command(rclone_decrypt)


@click.group(name="misc")
def misc_group() -> None:
    """Misc"""
    pass


misc_group.add_command(cal_numerology)
misc_group.add_command(rclone_group)
