common: some pylint cleanups
[gtk-doc.git] / gtkdoc-fixxref.in
blobeba83f9a66f7910ee46ef98db81cf815225b2887
1 #!@PYTHON@
2 # -*- python -*-
4 # gtk-doc - GTK DocBook documentation generator.
5 # Copyright (C) 1998  Damon Chaplin
6 #               2007-2016  Stefan Sauer
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 import argparse
24 import os
25 import sys
26 sys.path.append('@PYTHON_PACKAGE_DIR@')
28 from gtkdoc import config, fixxref
31 if __name__ == '__main__':
32     parser = argparse.ArgumentParser(
33         description='gtkdoc-fixxref version %s - fix cross references in html files' % config.version)
34     parser.add_argument('--version', action='version', version=config.version)
35     parser.add_argument('--module', default='', help='Name of the doc module being processed.')
36     parser.add_argument('--module-dir', default='',
37                         help='The directory which contains the generated HTML.')
38     parser.add_argument('--html-dir', default='',
39                         help='The directory where gtk-doc generated documentation is'
40                        'installed.')
41     parser.add_argument('--extra-dir', default=[], action='append',
42                         help='Directories to recursively scan for indices (index.sgml)'
43                         'in addition to HTML_DIR')
44     parser.add_argument('--src-lang', default='c',
45                         help='Programing language used for syntax highlighting. The'
46                         'available languages depend on the source source'
47                         'highlighter you use.')
49     options = parser.parse_args()
50     if options.module == '':
51         print('Error, missing module.')
52         sys.exit(1)
54     if not options.module_dir:
55         options.module_dir = os.path.join(options.html_dir, options.module)
57     fixxref.Run(options)