Skip to content

Commit f57def4

Browse files
committed
Added '--limit' and '--nodetails'.
Removed 'f' in logging.warning for source not nvd/bdsa
1 parent 99c8fc5 commit f57def4

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

examples/get_bom_component_vulnerability_info.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@
4444
parser.add_argument("-s", "--save_dt",
4545
action='store_true',
4646
help="If set, the date/time will be saved to a file named '.last_run' in the current directory which can be used later with the -n option to see vulnerabilities published since the last run.")
47-
parser.add_argument("-l", "--limit", default=9999, help="Set limit on number of vulnerabilitties to retrieve (default 9999)")
48-
parser.add_argument("-nd", type=bool, default=False, help="Disables retrieving details for each vulnerability to reduce execution time")
47+
parser.add_argument("-l", "--limit",
48+
default=9999,
49+
help="Set limit on number of vulnerabilitties to retrieve (default 9999)")
50+
parser.add_argument("-nd", "--nodetails",
51+
action='store_true',
52+
help="If set, disables retrieving details for each vulnerability to reduce execution time")
4953
args = parser.parse_args()
5054

5155

@@ -69,7 +73,7 @@
6973
version = hub.get_version_by_name(project, args.version)
7074
version_id = object_id(version)
7175

72-
vulnerablity_limit = "limit?={}".format(args.limit)
76+
vulnerablity_limit = "?limit={}".format(args.limit)
7377

7478
vulnerable_components_url = hub.get_link(version, "vulnerable-components") + vulnerablity_limit
7579
custom_headers = {'Accept':'application/vnd.blackducksoftware.bill-of-materials-6+json'}
@@ -113,7 +117,7 @@
113117
elif source == "NVD":
114118
cve_records.add(vuln_name)
115119
else:
116-
logging.warning(f"source {source} was not recognized")
120+
logging.warning("source {source} was not recognized")
117121

118122
if vulnerable_bom_components:
119123
vulnerable_bom_components = sorted(

0 commit comments

Comments
 (0)