added comments

This commit is contained in:
Cédric Bonhomme 2020-01-06 22:33:21 +01:00
parent df6c4c163e
commit a98bc11227
No known key found for this signature in database
GPG key ID: A1CB94DE57B7A70D

View file

@ -55,6 +55,7 @@ def main():
parser.print_usage() parser.print_usage()
parser.exit() parser.exit()
# Launch the process
all_potential_vulnerabilities, all_cve_found, found = find( all_potential_vulnerabilities, all_cve_found, found = find(
args.r, args.r,
tags_matching=args.t, tags_matching=args.t,
@ -63,11 +64,13 @@ def main():
defaultpattern=args.p, defaultpattern=args.p,
) )
# Output the result as json. Can be piped to another software.
if not args.c: if not args.c:
print(json.dumps(all_potential_vulnerabilities)) print(json.dumps(all_potential_vulnerabilities))
elif args.c: elif args.c:
print(json.dumps(list(all_cve_found))) print(json.dumps(list(all_cve_found)))
# Output the result to stderr.
print( print(
"{} CVE referenced found in commit(s)".format(len(list(all_cve_found))), "{} CVE referenced found in commit(s)".format(len(list(all_cve_found))),
file=sys.stderr, file=sys.stderr,