docmain: Support an include path for GIRs
authorJasper St. Pierre <jstpierre@mecheye.net>
Sun, 3 Feb 2013 12:31:52 +0000 (07:31 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Mon, 11 Feb 2013 17:34:52 +0000 (12:34 -0500)
We need this to replace the test infrastructure so it can find
Utility-1.0.gir

giscanner/docmain.py

index 8919eabbe75a55ae3fb089bd64bf1bd24e0ff450..cd782fefd9638d1fb4745119c97d7467eb99636a 100644 (file)
@@ -34,6 +34,9 @@ def doc_main(args):
                       action="store", dest="language",
                       default="Python",
                       help="Output language")
+    parser.add_option("", "--add-include-path",
+                      action="append", dest="include_paths", default=[],
+                      help="include paths for other GIR files")
 
     options, args = parser.parse_args(args)
     if not options.output:
@@ -50,6 +53,7 @@ def doc_main(args):
         extra_include_dirs = [os.path.join(top_srcdir, 'gir'), top_builddir]
     else:
         extra_include_dirs = []
+    extra_include_dirs.extend(options.include_paths)
     transformer = Transformer.parse_from_gir(args[1], extra_include_dirs)
 
     writer = DocWriter(transformer, options.language)