def main(): """Run the script in for debugging/Doxygen XML output inspection.""" import sys from optparse import OptionParser from reporter import Reporter parser = OptionParser() parser.add_option('-R', '--root-dir', help='Doxygen XML root directory') parser.add_option('-F', '--show-file', action='append', help='Show contents of given file') parser.add_option('-d', '--show-dir', action='append', help='Show contents of given directory') parser.add_option('-g', '--show-group', action='append', help='Show contents of given group') parser.add_option('-n', '--show-namespace', action='append', help='Show contents of given namespace') parser.add_option('-c', '--show-class', action='append', help='Show contents of given class') # TODO: Add option for other types, and make them work parser.add_option('-f', '--show-function', action='append', help='Show details of given function') options, args = parser.parse_args() reporter = Reporter() sys.stderr.write('Loading index.xml...\n') docset = DocumentationSet(options.root_dir, reporter) reporter.write_pending() sys.stderr.write('Loading details...\n') docset.load_details() reporter.write_pending() sys.stderr.write('Processing...\n') docset.merge_duplicates() reporter.write_pending() objlist = [] if options.show_file: objlist.extend(docset.get_files(tuple(options.show_file))) if options.show_dir: objlist.extend(docset.get_directories(tuple(options.show_dir))) if options.show_group: objlist.extend(docset.get_groups(tuple(options.show_group))) if options.show_namespace: # TODO: Replace file names with anonymous_namespace{filename} objlist.extend(docset.get_namespaces(tuple(options.show_namespace))) if options.show_class: objlist.extend(docset.get_classes(tuple(options.show_class))) if options.show_function: objlist.extend(docset.get_functions(tuple(options.show_function))) for obj in objlist: obj.show()