fix: enable special case "--release=final"

This commit is contained in:
Manuel Barkhau 2018-12-20 15:25:22 +01:00
parent e97ead4254
commit cdbf5c6627

View file

@ -216,7 +216,10 @@ def _bump(cfg: config.Config, new_version: str, allow_dirty: bool = False) -> No
"--dry", default=False, is_flag=True, help="Display diff of changes, don't rewrite files." "--dry", default=False, is_flag=True, help="Display diff of changes, don't rewrite files."
) )
@click.option( @click.option(
"--release", default=None, metavar="<name>", help="Override release name of current_version" "--release", default=None, metavar="<name>", help=(
f"Override release name of current_version. Valid options are: "
f"{', '.join(parse.VALID_RELEASE_VALUES)} and final."
)
) )
@click.option( @click.option(
"--allow-dirty", "--allow-dirty",
@ -239,7 +242,7 @@ def bump(
verbose = max(_VERBOSE, verbose) verbose = max(_VERBOSE, verbose)
_init_logging(verbose) _init_logging(verbose)
if release and release not in parse.VALID_RELEASE_VALUES: if release and release != 'final' and release not in parse.VALID_RELEASE_VALUES:
log.error(f"Invalid argument --release={release}") log.error(f"Invalid argument --release={release}")
log.error(f"Valid arguments are: {', '.join(parse.VALID_RELEASE_VALUES)}") log.error(f"Valid arguments are: {', '.join(parse.VALID_RELEASE_VALUES)}")
sys.exit(1) sys.exit(1)