import re
import click


def click_validate_reposlug(ctx, param, value):
    """Validate reposlugs (Click callback)

    :param ctx: Click context
    :type  ctx: class:`click.Context`
    :param param: Click params
    :type  param: dict
    :param value: reposlugs to validate
    :type  value: tuple

    :return: validated reposlugs
    :rtype:  str
    """
    rgx = re.compile('^[^/ ]+/[^/ ]+$')  # name/repo
    for val in value:
        if not rgx.fullmatch(val):
            raise click.BadParameter('not in owner/repository format')
    return value