import click
import functools


def with_git(f):
    """Wrap a command to add options for creating a git tag before or after the version bump."""

    @click.option(
        "--git-tag-before/--no-git-tag-before",
        default=False,
        help="If True, tag the repo, then version bump.",
    )
    @click.option(
        "--git-tag-after/--no-git-tag-after",
        default=False,
        help="If True, bump, then commit the changed files and tag the repo.",
    )
    @functools.wraps(f)
    def wrapper(*args, **kwargs):
        return f(*args, **kwargs)

    return wrapper