Invert negative arguments in --help parsing
"Negative logic" is harder to follow. We may define only a negative option for users, but we should still convert it to a normal boolean internally.
This commit is contained in:
parent
91907b066f
commit
91230d4eba
1 changed files with 6 additions and 4 deletions
|
@ -367,9 +367,11 @@ def main():
|
|||
help="Print license mappings and exit")
|
||||
parser.add_argument("--translate-license", action="store_true",
|
||||
help="Print mapping for specified license and exit")
|
||||
parser.add_argument("--no-auto-changelog-entry", action="store_true",
|
||||
parser.add_argument("--no-auto-changelog-entry", action="store_false",
|
||||
default=True, dest="auto_changelog_entry",
|
||||
help="Do not generate a changelog entry")
|
||||
parser.add_argument("--no-existence-check", action="store_true",
|
||||
parser.add_argument("--no-existence-check", action="store_false",
|
||||
default=True, dest="existence_check",
|
||||
help="Do not check whether the package already exists in dist-git")
|
||||
parser.add_argument("-", "--stdout", action="store_true",
|
||||
help="Print spec and patches into stdout")
|
||||
|
@ -459,7 +461,7 @@ def main():
|
|||
kwargs["pkg_suffix"] = suffix
|
||||
spec_file = pathlib.Path(f"rust-{metadata.name}{suffix}.spec")
|
||||
|
||||
if args.target in {"fedora"} and not args.no_existence_check and not os.path.exists(spec_file):
|
||||
if args.target in {"fedora"} and args.existence_check and not os.path.exists(spec_file):
|
||||
# No specfile, so this is probably a new package
|
||||
package_info = get_package_info(f"rust-{metadata.name}{suffix}")
|
||||
if package_info:
|
||||
|
@ -467,7 +469,7 @@ def main():
|
|||
print("Re-run with --no-existence-check if you still want to convert it.")
|
||||
sys.exit(1)
|
||||
|
||||
kwargs["auto_changelog_entry"] = not args.no_auto_changelog_entry
|
||||
kwargs["auto_changelog_entry"] = args.auto_changelog_entry
|
||||
|
||||
rpmautospec = args.rpmautospec
|
||||
if rpmautospec is None:
|
||||
|
|
Loading…
Reference in a new issue