You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/nbl/builtin/builtinDataGen.py
+25-14Lines changed: 25 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,26 @@
1
1
# Creates a c++ file for builtin resources that contains binary data of all resources
2
2
3
-
# TODO: use argparse not this by-hand-shit
4
-
5
-
importsys, os, subprocess, json
3
+
importargparse, os, subprocess, json
6
4
fromdatetimeimportdatetime, timezone
7
5
8
-
iflen(sys.argv) <8 :
9
-
print(sys.argv[0] +" - Incorrect argument count")
10
-
else:
11
-
outputBuiltinPath=sys.argv[1]
12
-
outputArchivePath=sys.argv[2]
13
-
bundleAbsoluteEntryPath=sys.argv[3]
14
-
resourcesFile=sys.argv[4]
15
-
resourcesNamespace=sys.argv[5]
16
-
correspondingHeaderFile=sys.argv[6]
17
-
xxHash256Exe=sys.argv[7]
6
+
7
+
parser=argparse.ArgumentParser(description="Creates a c++ file for builtin resources that contains binary data of all resources")
8
+
parser.add_argument('--outputBuiltinPath', required=True, help="output path of generated C++ builtin data source")
9
+
parser.add_argument('--outputArchivePath', required=True, help="output path of generated C++ archive data source")
10
+
parser.add_argument('--bundleAbsoluteEntryPath', required=True, help="\"absolute path\" for an archive which will store a given bundle of builtin resources")
11
+
parser.add_argument('--resourcesFile', required=True, help="path to file containing resources list")
12
+
parser.add_argument('--resourcesNamespace', required=True, help="a C++ namespace builtin resources will be wrapped into")
13
+
parser.add_argument('--correspondingHeaderFile', required=True, help="filename of previosly generated header (via buitinHeaderGen.py)")
14
+
parser.add_argument('--xxHash256Exe', default="", nargs='?', help="path to xxHash256 executable")
0 commit comments