@@ -1,5 +1,6 @@
#!/usr/bin/env python3
+import argparse
import json
import re
import semver
@@ -7,10 +8,15 @@ import sys
from git import Repo
-# this is the repository where we fetch most of our tag data
-GIT_REPO = sys.argv[1]
-# the bitbake repository is used to associate bitbake versions to them
-BITBAKE_REPO = sys.argv[2]
+parser = argparse.ArgumentParser(
+ description="Parse Yocto Project release tags and generate releases.json"
+)
+parser.add_argument("docs_repo", help="Path to the yocto-docs git repository")
+parser.add_argument("bitbake_repo", help="Path to the bitbake git repository")
+args = parser.parse_args()
+
+GIT_REPO = args.docs_repo
+BITBAKE_REPO = args.bitbake_repo
print(f"Reading tag information in {GIT_REPO}")
scripts/release-parser: use argparse for argument handling Replace raw sys.argv access with argparse so that usage and help text are printed when the script is called without the required arguments. Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org> --- scripts/release-parser.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)