Preparing to pass more parameters depending of build configuration to
create GLES dispatch tables too.

Signed-off-by: Pauli Nieminen <[email protected]>
---
 glapi/parse_glspec.py |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/glapi/parse_glspec.py b/glapi/parse_glspec.py
index ac624eb..3a1c848 100644
--- a/glapi/parse_glspec.py
+++ b/glapi/parse_glspec.py
@@ -459,11 +459,18 @@ class Api(object):
 
 if __name__ == '__main__':
     api = Api()
-    with open(sys.argv[1]) as f:
-        api.read_gl_tm(f)
-    with open(sys.argv[2]) as f:
-        api.read_gl_spec(f)
-    with open(sys.argv[3]) as f:
-        api.read_enumext_spec(f)
-    with open(sys.argv[4], 'w') as f:
-       f.write(api.to_json())
+    for name in sys.argv:
+       if name.endswith('.py'):
+           continue
+       elif name.endswith('gl.tm'):
+           with open(name) as f:
+               api.read_gl_tm(f)
+       elif name.endswith('gl.spec'):
+           with open(name) as f:
+               api.read_gl_spec(f)
+       elif name.endswith('enumext.spec'):
+           with open(name) as f:
+               api.read_enumext_spec(f)
+       elif name.endswith('.json'):
+           with open(name, 'w') as f:
+               f.write(api.to_json())
-- 
1.7.5.4

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to