[gtk-doc] tools: cleanup options handling
- From: Stefan Sauer <stefkost src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-doc] tools: cleanup options handling
- Date: Thu, 22 Jun 2017 20:07:47 +0000 (UTC)
commit bf86d52e5977f28b660d78b62ea4230cc8c6c975
Author: Stefan Sauer <ensonic users sf net>
Date: Thu Jun 22 21:56:30 2017 +0200
tools: cleanup options handling
Use the 'required' flags for mandatory args. Drop some dest flags where not needed.
gtkdoc-fixxref.in | 6 ++----
gtkdoc-mkdb.in | 6 ++----
gtkdoc-rebase.in | 9 +++------
gtkdoc-scan.in | 6 ++----
gtkdoc-scangobj.in | 2 +-
5 files changed, 10 insertions(+), 19 deletions(-)
---
diff --git a/gtkdoc-fixxref.in b/gtkdoc-fixxref.in
index 598a2ab..0ea02d4 100755
--- a/gtkdoc-fixxref.in
+++ b/gtkdoc-fixxref.in
@@ -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)
diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in
index 9765904..42d5731 100755
--- a/gtkdoc-mkdb.in
+++ b/gtkdoc-mkdb.in
@@ -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)
diff --git a/gtkdoc-rebase.in b/gtkdoc-rebase.in
index 482721c..17a71c2 100755
--- a/gtkdoc-rebase.in
+++ b/gtkdoc-rebase.in
@@ -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))
diff --git a/gtkdoc-scan.in b/gtkdoc-scan.in
index cd6c0f2..954c811 100755
--- a/gtkdoc-scan.in
+++ b/gtkdoc-scan.in
@@ -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()
diff --git a/gtkdoc-scangobj.in b/gtkdoc-scangobj.in
index 4103194..4cbe130 100644
--- a/gtkdoc-scangobj.in
+++ b/gtkdoc-scangobj.in
@@ -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')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]