from typing import List
from typing import Callable


def add_options(options: List[Callable]) -> Callable:
    """Decorator to apply shared options to all dgtest CLI commands

    Args:
        options: A list of Click options to be applied to any number of Click commands

    Returns:
        A callable function used to apply click.option decorators to a command

    """

    def _add_options(func: Callable) -> Callable:
        for option in reversed(options):
            func = option(func)
        return func

    return _add_options