[gobject-introspection] g-ir-doc-tool: Change the -o option to receive a directory



commit 19c1bbbdd1fbb865fc48224a4b3e1f1e6297d2f4
Author: Tomeu Vizoso <tomeu vizoso collabora com>
Date:   Mon Feb 20 18:37:08 2012 +0100

    g-ir-doc-tool: Change the -o option to receive a directory

 giscanner/docmain.py      |    4 +++-
 tests/doctool/Makefile.am |    4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/giscanner/docmain.py b/giscanner/docmain.py
index e3ef4ae..1ca92a1 100644
--- a/giscanner/docmain.py
+++ b/giscanner/docmain.py
@@ -29,7 +29,7 @@ def doc_main(args):
 
     parser.add_option("-o", "--output",
                       action="store", dest="output",
-                      help="Filename to write output")
+                      help="Directory to write output to")
     parser.add_option("-l", "--language",
                       action="store", dest="language",
                       default="Python",
@@ -38,6 +38,8 @@ def doc_main(args):
     options, args = parser.parse_args(args)
     if not options.output:
         raise SystemExit("missing output parameter")
+    if not os.path.isdir(options.output):
+        raise SystemExit("wrong output parameter: %s", options.output)
 
     if len(args) < 2:
         raise SystemExit("Need an input GIR filename")
diff --git a/tests/doctool/Makefile.am b/tests/doctool/Makefile.am
index 5bb84a6..0bac1f7 100644
--- a/tests/doctool/Makefile.am
+++ b/tests/doctool/Makefile.am
@@ -12,10 +12,10 @@ EXTRA_DIST = $(EXPECTED_MALLARD_DIRS)
 	cp ../../$*.gir .
 
 %-C: %.gir
-	mkdir $*-C ; rm $*-C/*.page ; $(INTROSPECTION_DOCTOOL) --language C $*.gir -o $*-C/index.page && echo "  GEN  $*-C/index.page"
+	mkdir $*-C ; rm $*-C/*.page ; $(INTROSPECTION_DOCTOOL) --language C $*.gir -o $*-C/ && echo "  GEN  $*-C/index.page"
 
 %-Python: %.gir
-	mkdir $*-Python ; rm $*-Python/*.page ; $(INTROSPECTION_DOCTOOL) --language Python $*.gir -o $*-Python/index.page && echo "  GEN  $*-Python/index.page"
+	mkdir $*-Python ; rm $*-Python/*.page ; $(INTROSPECTION_DOCTOOL) --language Python $*.gir -o $*-Python/ && echo "  GEN  $*-Python/index.page"
 
 %-C.page.check: %-C
 	@diff -u -U 10 $(srcdir)/$*-C-expected $*-C && echo "  TEST  $*-C" && rm -rf $*-C



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]