import click


@click.command()
@click.argument("file", type=click.Path(exists=True))
@click.option("--port", default=8080, help="Port to serve on")
@click.option("--no-open", is_flag=True, help="Don't open browser automatically")
def serve(file, port, no_open):
    """Open a dataset in a browser map using a local Leaflet server."""
    from geo.server.app import run_server
    run_server(file, port=port, open_browser=not no_open)
