import click


def require(*opts: str):
    """Require a Click flag to be set"""
    def _validate(ctx, param, value):
        if value:
            for opt in opts:
                if not ctx.params.get(opt):
                    raise click.UsageError(f"Parameter {param.name} requires {opt}, but not found")

        return value

    return _validate