Commit bf86d52e authored by Stefan Sauer's avatar Stefan Sauer

tools: cleanup options handling

Use the 'required' flags for mandatory args. Drop some dest flags where not needed.
parent a6da7887
......@@ -32,7 +32,8 @@ if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='gtkdoc-fixxref version %s - fix cross references in html files' % config.version)
parser.add_argument('--version', action='version', version=config.version)
parser.add_argument('--module', default='', help='Name of the doc module being processed.')
parser.add_argument('--module', required=True,
help='Name of the doc module being processed.')
parser.add_argument('--module-dir', default='',
help='The directory which contains the generated HTML.')
parser.add_argument('--html-dir', default='',
......@@ -47,9 +48,6 @@ if __name__ == '__main__':
'highlighter you use.')
options = parser.parse_args()
if options.module == '':
print('Error, missing module.')
sys.exit(1)
if not options.module_dir:
options.module_dir = os.path.join(options.html_dir, options.module)
......
......@@ -31,7 +31,8 @@ from gtkdoc import common, config, mkdb
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--version', action='version', version=config.version)
parser.add_argument('--module', default='')
parser.add_argument('--module', required=True,
help='Name of the doc module being parsed')
parser.add_argument('--source-dir', action='append', dest='source_dir', default=[])
parser.add_argument('--source-suffixes', dest='source_suffixes', default='')
parser.add_argument('--ignore-files', dest='ignore_files', default='')
......@@ -51,9 +52,6 @@ if __name__ == '__main__':
parser.add_argument('--outputsymbolswithoutsince', default=False, action='store_true')
options = parser.parse_args()
if options.module == '':
print('Error, missing module.')
sys.exit(1)
if options.output_format != "xml":
sys.exit('Invalid format "%s" passed to --output.format' % options.output_format)
......
......@@ -32,12 +32,12 @@ if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='gtkdoc-rebase version %s - rewrite links in html docs' % config.version)
parser.add_argument('--version', action='version', version=config.version)
parser.add_argument('--html-dir', dest='html_dir', default='',
parser.add_argument('--html-dir', required=True,
help='The directory which contains the installed HTML')
parser.add_argument('--other-dir', dest='other_dir', default=[], action='append',
parser.add_argument('--other-dir', default=[], action='append',
help='Directories to recursively scan for indices (*.devhelp2).'
'May be used more than once for multiple directories.')
parser.add_argument('--dest-dir', dest='dest_dir', default='',
parser.add_argument('--dest-dir', default='',
help='Staging area virtual root, this prefix will be removed'
'from HTML_DIR for relative link calculation.')
parser.add_argument('--aggressive', action='store_true', default=False,
......@@ -51,9 +51,6 @@ if __name__ == '__main__':
options = parser.parse_args()
if options.html_dir == '':
sys.exit("No HTML directory (--html-dir) given.")
common.setup_logging()
sys.exit(rebase.run(options))
......@@ -32,7 +32,8 @@ if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='gtkdoc-scan version %s - scan header files for public symbols' % config.version)
parser.add_argument('--version', action='version', version=config.version)
parser.add_argument('--module', default='', help='Name of the doc module being parsed.')
parser.add_argument('--module', required=True,
help='Name of the doc module being processed.')
parser.add_argument('--source-dir', action='append', default=[],
help='Directories containing the source files to scan')
parser.add_argument('--ignore-headers', default='',
......@@ -52,9 +53,6 @@ if __name__ == '__main__':
parser.add_argument('headers', nargs='*')
options = parser.parse_args()
if options.module == '':
print('Error, missing module.')
sys.exit(1)
common.setup_logging()
......
......@@ -31,7 +31,7 @@ if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='gtkdoc-rebase version %s - introspect g-objects' % config.version)
parser.add_argument('--version', action='version', version=config.version)
parser.add_argument('--module', default='',
parser.add_argument('--module', required=True,
help='Name of the doc module being parsed')
parser.add_argument('--types', default='',
help='The name of the file to store the types in')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment