import click
import functools


def with_prerel(f):
    """Wrap a command to add the prerel option, which if True means to bump with a prerelease."""

    @click.option(
        "--prerel/--no-prerel",
        default=True,
        help="If True, also make the version a prerelease version.",
    )
    @functools.wraps(f)
    def wrapper(*args, **kwargs):
        return f(*args, **kwargs)

    return wrapper