compare-disco: prepare for primitive argument parsing
authorPierre-Yves DAVID <pierre-yves.david@octobus.net>
Sat, 04 Jun 2022 18:57:19 +0200
changeset 49482 df1d4e442c08
parent 49481 53229e170496
child 49483 3c026138f234
compare-disco: prepare for primitive argument parsing We need to be able to configure a couple of things, so lets prepare the code for it. (the code is hacky, but this is a quicky and dirty debug script)
contrib/perf-utils/compare-discovery-case
--- a/contrib/perf-utils/compare-discovery-case	Mon Aug 22 16:59:14 2022 -0400
+++ b/contrib/perf-utils/compare-discovery-case	Sat Jun 04 18:57:19 2022 +0200
@@ -171,13 +171,18 @@
 
 
 if __name__ == '__main__':
-    if len(sys.argv) != 4:
+
+    argv = sys.argv[:]
+
+    kwargs = {}
+
+    if len(argv) != 4:
         usage = f'USAGE: {script_name} REPO LOCAL_CASE REMOTE_CASE'
         print(usage, file=sys.stderr)
         sys.exit(128)
-    repo = sys.argv[1]
-    local_case = sys.argv[2].split('-')
+    repo = argv[1]
+    local_case = argv[2].split('-')
     local_case = (local_case[0],) + tuple(int(x) for x in local_case[1:])
-    remote_case = sys.argv[3].split('-')
+    remote_case = argv[3].split('-')
     remote_case = (remote_case[0],) + tuple(int(x) for x in remote_case[1:])
-    sys.exit(compare(repo, local_case, remote_case))
+    sys.exit(compare(repo, local_case, remote_case, **kwargs))