summaryrefslogtreecommitdiff
path: root/spice_codegen.py
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-06-18 13:43:45 +0200
committerMarc-André Lureau <marcandre.lureau@gmail.com>2012-03-20 15:25:43 +0100
commit9a9f1b8081e2b5271ebe346f47efc3287841bca5 (patch)
treea910be53e6e8ba81b86b04e4a3c38398a313d519 /spice_codegen.py
parent212bf0ddee9432ae01004bdeb4ae1c796e7ec905 (diff)
Allow multiple --include args
Diffstat (limited to 'spice_codegen.py')
-rwxr-xr-xspice_codegen.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/spice_codegen.py b/spice_codegen.py
index 0e9551f..c8d0d5f 100755
--- a/spice_codegen.py
+++ b/spice_codegen.py
@@ -108,7 +108,7 @@ parser.add_option("-k", "--keep-identical-file",
action="store_true", dest="keep_identical_file", default=False,
help="Print errors")
parser.add_option("-i", "--include",
- dest="include", default=None, metavar="FILE",
+ action="append", dest="includes", metavar="FILE",
help="Include FILE in generated code")
(options, args) = parser.parse_args()
@@ -137,8 +137,9 @@ if options.assert_on_error:
if options.print_error:
writer.set_option("print_error")
-if options.include:
- writer.writeln('#include "%s"' % options.include)
+if options.includes:
+ for i in options.includes:
+ writer.writeln('#include "%s"' % i)
if options.generate_enums:
write_enums(writer)