import click


def end_option(func):
    """Option for setting an end date in the search."""
    return click.option(
        '--end',
        'end_date',
        type=click.DateTime(formats=['%Y-%m-%d']),
        help="Show sites before this date (YYYY-MM-DD)."
    )(func)