Skip to content

Commit

Permalink
csmock: simplify handling of --known-false-positives
Browse files Browse the repository at this point in the history
This is a follow-up to the previous commit that further simplifies
the code with no intended changes in behavior.

Closes: #118
  • Loading branch information
kdudka committed Aug 29, 2023
1 parent 202fd3e commit 38211c6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions py/csmock
Original file line number Diff line number Diff line change
Expand Up @@ -895,15 +895,14 @@ key event (defaults to 3).")
help="use shell command to build the given tarball (instead of SRPM)")

# --known-false-positives
if os.path.exists(DEFAULT_KNOWN_FALSE_POSITIVES):
default_kfp = DEFAULT_KNOWN_FALSE_POSITIVES
default_kfp_text = " (defaults to \"%s\")" % default_kfp
else:
default_kfp = DEFAULT_KNOWN_FALSE_POSITIVES
default_kfp_text = f'defaults to "{default_kfp}"'
if not os.path.exists(default_kfp):
default_kfp = ""
default_kfp_text = " (defaults to \"%s\" if available)" % DEFAULT_KNOWN_FALSE_POSITIVES
default_kfp_text += " if available"
parser.add_argument(
"--known-false-positives", default=default_kfp,
help=("suppress known false positives loaded from the given file" + default_kfp_text))
help=f"suppress known false positives loaded from the given file ({default_kfp_text})")

csmock.common.util.add_paired_flag(
parser, "use-login-shell",
Expand Down

0 comments on commit 38211c6

Please sign in to comment.