import click


def _add_click_parameters(params, **kwargs):
    """
    Given a list of click parameter objects,
    attach them in the decorator to the click command.
    """
    def decorator(f):
        # Add in reverse order
        for idx in range(len(params)-1, -1, -1):
            param = params[idx]
            click.decorators._param_memo(f, param)
        return f
    return decorator