mirror of
https://gitlab.freedesktop.org/xorg/lib/libxcb-errors.git
synced 2026-05-08 10:08:05 +02:00
extensions.py: use argparse for arguments
We're going to make more use of this later
This commit is contained in:
parent
f25753ddd0
commit
c4c32acbae
1 changed files with 8 additions and 3 deletions
|
|
@ -1,4 +1,5 @@
|
|||
#!/usr/bin/env python
|
||||
import argparse
|
||||
import sys
|
||||
from xml.etree.cElementTree import parse
|
||||
|
||||
|
|
@ -111,14 +112,18 @@ def emit_module(module, output):
|
|||
|
||||
def main():
|
||||
# Parse the xml file
|
||||
output_file = sys.argv[1]
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('output')
|
||||
parser.add_argument('inputs', nargs='+')
|
||||
args = parser.parse_args()
|
||||
|
||||
modules = []
|
||||
for input_file in sys.argv[2:]:
|
||||
for input_file in args.inputs:
|
||||
parseFile(input_file, modules)
|
||||
|
||||
assert xproto != None
|
||||
|
||||
with open(output_file, "w") as output:
|
||||
with open(args.output, "w") as output:
|
||||
output.write("/* Auto-generated file, do not edit */\n")
|
||||
output.write('#include "errors.h"\n')
|
||||
output.write("#include <string.h>\n")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue