import re
import click


def validate_coordinate(ctx, param, value):
    """Ensures the passed parameter is formatted: <LATITUDE>,<LONGITUDE>"""

    if not re.search(r'-?\d+(.\d+)?\,-?\d+(.\d+)?', value, re.DOTALL):
        raise click.BadParameter('Coordinates must be in the format: '
                                 '123.23,42.1 <LATITUDE,LONGITUDE>')
    return value