common: port more functions and fix one
[gtk-doc.git] / gtkdoc-scan.in
blob4a7c008b38ac665a586066b20903ec71d764a5e7
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 from __future__ import print_function
25 import argparse
26 import sys
27 sys.path.append('@PYTHON_PACKAGE_DIR@')
29 from gtkdoc import config, scan
31 if __name__ == '__main__':
32     parser = argparse.ArgumentParser(
33         description='gtkdoc-scan version %s - scan header files for public symbols' % 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 parsed.')
36     parser.add_argument('--source-dir', action='append', default=[],
37                         help='Directories containing the source files to scan')
38     parser.add_argument('--ignore-headers', default='',
39                         help='A space-separated list of header files/dirs not to scan')
40     parser.add_argument('--output-dir', default='.',
41                         help='The directory where the results are stored')
42     parser.add_argument('--deprecated-guards', default='does_not_match_any_cpp_symbols_at_all_nope',
43                         help='A |-separated list of symbols used as deprecation guards')
44     parser.add_argument('--ignore-decorators', default='(?=no)match',
45                         help='A |-separated list of additional decorators in'
46                         'declarations that should be ignored')
47     parser.add_argument('--rebuild-sections', action='store_true', default=False,
48                         help='Rebuild (overwrite) the MODULE-sections.txt file')
49     parser.add_argument('--rebuild-types', action='store_true', default=False,
50                         help='Automatically recreate the MODULE.types file using'
51                         'all the *_get_type() functions found')
52     parser.add_argument('headers', nargs='*')
54     options = parser.parse_args()
55     if options.module == '':
56         print('Error, missing module.')
57         sys.exit(1)
59     scan.Run(options)