import click
import functools


def returns_gdf(func):
    """Marks a callback as returning the new GeoDataFrame object."""
    def wrapper(*args, **kwargs):
        ctx = click.get_current_context().find_root()
        ctx.obj = func(*args, **kwargs)
        return ctx.obj
    return functools.update_wrapper(wrapper, func)