diff options
author | Tomeu Vizoso <tomeu.vizoso@collabora.co.uk> | 2011-08-14 11:10:14 +0200 |
---|---|---|
committer | Tomeu Vizoso <tomeu.vizoso@collabora.co.uk> | 2011-08-15 11:36:49 +0200 |
commit | b15800a2ab572e2713b5ace3e3bca1b5958257f5 (patch) | |
tree | 7107d026e589d040fa4b88db6cc47c8d6ebac4f6 /giscanner/docmain.py | |
parent | a71cf2d949eda31211a59d81fd9a222fba50575b (diff) | |
download | gobject-introspection-b15800a2ab572e2713b5ace3e3bca1b5958257f5.tar.gz |
g-ir-doc-tool: Add -expected test for Python docbook
Diffstat (limited to 'giscanner/docmain.py')
-rw-r--r-- | giscanner/docmain.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/giscanner/docmain.py b/giscanner/docmain.py index 29b5ddfb..3bffaefe 100644 --- a/giscanner/docmain.py +++ b/giscanner/docmain.py @@ -21,6 +21,8 @@ import optparse from .docbookwriter import DocBookWriter +from .docbookwriter import DocBookFormatterC +from .docbookwriter import DocBookFormatterPython from .transformer import Transformer class GIDocGenerator(object): @@ -42,6 +44,10 @@ def doc_main(args): action="store", dest="format", default="docbook", help="Output format") + parser.add_option("-l", "--language", + action="store", dest="language", + default="Python", + help="Output language") options, args = parser.parse_args(args) if not options.output: @@ -50,8 +56,15 @@ def doc_main(args): if len(args) < 2: raise SystemExit("Need an input GIR filename") + if options.language == "Python": + formatter = DocBookFormatterPython() + elif options.language == "C": + formatter = DocBookFormatterC() + else: + raise SystemExit("Unsupported language: %s" % (options.language, )) + if options.format == "docbook": - writer = DocBookWriter() + writer = DocBookWriter(formatter) else: raise SystemExit("Unsupported output format: %s" % (options.format, )) |