import click


def sync_options(func):
    options = [click.option("--username"), click.option("--password"), click.option("--ip")]
    for option in reversed(options):
        func = option(func)
    return func


def generate_command(username, ip, password, path, service_name: str) -> str:
    command = (
        f"kubectl exec deployment/{service_name} --container {service_name} -- "
        f"/bin/sh -c \"sshpass -p '{password}' rsync -e 'ssh -o StrictHostKeyChecking=no' -avzh"
        f' {username}@{ip}:{path} /home/syneto-{service_name}"'
    )
    return command


def generate_pantheon_command(username, ip, password, path, service_name: str) -> str:
    command = (
        f"kubectl exec deployment/{service_name} --container {service_name} -- "
        f"/bin/sh -c \"sshpass -p '{password}' rsync -avzh -e 'ssh -o StrictHostKeyChecking=no'"
        f' {username}@{ip}:{path} /home/syneto-{service_name}/.venv/lib/python3.9/site-packages/pantheon/"'
    )
    return command
