tools/gen-cve-release-notes: add argparse support
PATCH 1/1 tools/gen-cve-release-notes: add argparse support
No behavior changes, just the addition of argparse to have a user-friendly interface.
Signed-off-by Antonin Godard <[email protected]>
--- documentation/tools/gen-cve-release-notes | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
documentation/tools/gen-cve-release-notes +9 -4
@@ -7,17 +7,22 @@ # - the CVE status changes from Unpatched to Patched in the new report. # - the Unpatched CVE is unlisted in the new report. # -# Reports can be found here: https://valkyrie.yocto.io/pub/non-release/?type=metrics +# Reports can be found here: https://git.yoctoproject.org/yocto-metrics/plain/cve-check/ +import argparse import sys import json -json_prev_path = sys.argv[1] -json_next_path = sys.argv[2] +parser = argparse.ArgumentParser( + description="Compare CVE reports between releases and output docs-formatted array" +) +parser.add_argument("json_prev_path", help="Path to the CVE report for the previous release") +parser.add_argument("json_next_path", help="Path to the CVE report for the next release") +args = parser.parse_args() data_prev, data_next = None, None -with open(json_prev_path, 'r') as fd_prev, open(json_prev_path, 'r') as fd_next: +with open(args.json_prev_path, 'r') as fd_prev, open(args.json_prev_path, 'r') as fd_next: data_prev = json.load(fd_prev)["package"] data_next = json.load(fd_next)["package"]
---
base-commit: 358519ca6406a89fee42c45dcaf63a37a374f33c
change-id: 20260421-argparse-gen-cve-release-notes-c022a779bf9a
Antonin Godard
AppliedApplied, thanks!
[1/1] tools/gen-cve-release-notes: add argparse support
commit: 28814e69677619b7a01338560dd89f466601a92d