from typing import Callable
import click


def license_key_option(command: Callable[..., None]) -> Callable[..., None]:
    """
    An argument decorator for passing a license key.
    """
    function = click.option(
        '--license-key',
        type=click.Path(exists=True),
        envvar='DCOS_LICENSE_KEY_PATH',
        help=(
            'This is ignored if using open source DC/OS. '
            'If using DC/OS Enterprise, this defaults to the value of the '
            '`DCOS_LICENSE_KEY_PATH` environment variable.'
        ),
    )(command)  # type: Callable[..., None]
    return function