diff options
author | marha <marha@users.sourceforge.net> | 2015-06-15 21:36:28 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2015-06-15 21:36:28 +0200 |
commit | 008a8d8051786badb83e455bd9281103ba9a6470 (patch) | |
tree | f99ea672d105271cb60a726fac8022ce47ea2866 /mesalib/src/mapi/glapi/gen/gl_apitemp.py | |
parent | 912e881bec8b16f2331225960645c3bdf5a8ba2d (diff) | |
parent | e8d5e7c4bb11f7fcb0a4ba5c13f43e7929849a2f (diff) | |
download | vcxsrv-008a8d8051786badb83e455bd9281103ba9a6470.tar.gz vcxsrv-008a8d8051786badb83e455bd9281103ba9a6470.tar.bz2 vcxsrv-008a8d8051786badb83e455bd9281103ba9a6470.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
freetype/src/base/ftfntfmt.c
freetype/src/cache/ftcimage.c
freetype/src/cid/cidriver.c
freetype/src/truetype/ttdriver.c
mesalib/src/mesa/drivers/dri/common/dri_util.c
mesalib/src/mesa/drivers/dri/swrast/swrast.c
openssl/Makefile
Diffstat (limited to 'mesalib/src/mapi/glapi/gen/gl_apitemp.py')
-rwxr-xr-x | mesalib/src/mapi/glapi/gen/gl_apitemp.py | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/mesalib/src/mapi/glapi/gen/gl_apitemp.py b/mesalib/src/mapi/glapi/gen/gl_apitemp.py index 4157032c5..5e985a2ec 100755 --- a/mesalib/src/mapi/glapi/gen/gl_apitemp.py +++ b/mesalib/src/mapi/glapi/gen/gl_apitemp.py @@ -25,9 +25,10 @@ # Authors: # Ian Romanick <idr@us.ibm.com> +import argparse + import gl_XML, glX_XML import license -import sys, getopt class PrintGlOffsets(gl_XML.gl_print_base): def __init__(self, es=False): @@ -301,27 +302,30 @@ _glapi_proc UNUSED_TABLE_NAME[] = {""" return -def show_usage(): - print "Usage: %s [-f input_file_name] [-c]" % sys.argv[0] - print "-c Enable compatibility with OpenGL ES." - sys.exit(1) - -if __name__ == '__main__': - file_name = "gl_API.xml" +def _parser(): + """Parser arguments and return a namespace.""" + parser = argparse.ArgumentParser() + parser.add_argument('-f', + metavar='<input file name>', + dest='filename', + default="gl_API.xml", + help="An XML file describing the API.") + parser.add_argument('-c', + action='store_true', + dest='es', + help="Enable OpenGL ES compatibility") + return parser.parse_args() - try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:c") - except Exception,e: - show_usage() - es = False - for (arg,val) in args: - if arg == "-f": - file_name = val - elif arg == "-c": - es = True +def main(): + """Main function.""" + args = _parser() - api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory()) + api = gl_XML.parse_GL_API(args.filename, glX_XML.glx_item_factory()) - printer = PrintGlOffsets(es) + printer = PrintGlOffsets(args.es) printer.Print(api) + + +if __name__ == '__main__': + main() |