diff mbox series

tools/gen-cve-release-notes: add argparse support

Message ID 20260727-argparse-gen-cve-release-notes-v1-1-22e7ad7e9d06@bootlin.com
State New
Headers show
Series tools/gen-cve-release-notes: add argparse support | expand

Commit Message

Antonin Godard July 27, 2026, 7:43 a.m. UTC
No behavior changes, just the addition of argparse to have a
user-friendly interface.

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
 documentation/tools/gen-cve-release-notes | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)


---
base-commit: 358519ca6406a89fee42c45dcaf63a37a374f33c
change-id: 20260421-argparse-gen-cve-release-notes-c022a779bf9a
diff mbox series

Patch

diff --git a/documentation/tools/gen-cve-release-notes b/documentation/tools/gen-cve-release-notes
index 71d8fe502..84ac1a758 100755
--- a/documentation/tools/gen-cve-release-notes
+++ b/documentation/tools/gen-cve-release-notes
@@ -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"]