From b7c7651d1c35315d3d8f251f9b43f199a995006f Mon Sep 17 00:00:00 2001 From: Caroline Russell Date: Fri, 6 Dec 2024 13:56:19 -0500 Subject: [PATCH] Fix cli argument bug. (#45) Signed-off-by: Caroline Russell --- custom_json_diff/cli.py | 10 ++++++---- pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/custom_json_diff/cli.py b/custom_json_diff/cli.py index 9f68f45..b9a3e6e 100644 --- a/custom_json_diff/cli.py +++ b/custom_json_diff/cli.py @@ -21,12 +21,14 @@ def build_args() -> argparse.Namespace: version="%(prog)s " + version("custom_json_diff") ) parser.set_defaults( - preconfig_diff_type="", + preset_type="", allow_new_versions=False, report_template="", exclude=[], allow_new_data=False, - include=[] + include=[], + include_empty=True, + bom_profile=None ) parser.add_argument( "-i", @@ -129,8 +131,8 @@ def main(): preset_type = args.preset_type.lower() if preset_type and preset_type not in ("bom", "csaf"): raise ValueError("Preconfigured type must be either bom or csaf.") - if args.bom_profile: - if args.bom_profile not in ("gn", "gnv", "nv"): + if preset_type == "bom": + if args.bom_profile and args.bom_profile not in ("gn", "gnv", "nv"): raise ValueError("BOM profile must be either gn, gnv, or nv.") options = Options( allow_new_versions=args.allow_new_versions, diff --git a/pyproject.toml b/pyproject.toml index b6cc4ff..ea30eba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "custom-json-diff" -version = "2.1.4" +version = "2.1.5" description = "CycloneDx BOM and Oasis CSAF diffing and comparison tool." authors = [ { name = "Caroline Russell", email = "caroline@appthreat.dev" },