update-dbus-docs: omit verbose output when in --test mode
It makes the ninja output listing very long for no good purpose.
diff --git a/tools/update-dbus-docs.py b/tools/update-dbus-docs.py
index 448206c..0bbc4aa 100755
--- a/tools/update-dbus-docs.py
+++ b/tools/update-dbus-docs.py
@@ -15,8 +15,6 @@
strip_cdata=False,
resolve_entities=False)
-PRINT_ERRORS = True
-
class NoCommand(Exception):
pass
@@ -38,7 +36,7 @@
argname = arg.get('name')
if argname is None:
- if PRINT_ERRORS:
+ if opts.print_errors:
print(f'method {name}: argument {num+1} has no name', file=sys.stderr)
argname = 'UNNAMED'
@@ -140,7 +138,7 @@
assert False, (klass, item)
if not document_has_elem_with_text(document, elem, item_repr):
- if PRINT_ERRORS:
+ if opts.print_errors:
print(f'{klass} {item} is not documented :(')
missing.append((klass, item))
@@ -283,7 +281,9 @@
help='only verify that everything is up2date')
p.add_argument('--build-dir', default='build')
p.add_argument('pages', nargs='+')
- return p.parse_args()
+ opts = p.parse_args()
+ opts.print_errors = not opts.test
+ return opts
if __name__ == '__main__':
opts = parse_args()