codegen: Require at least one interface file to be specified

Previously, running `gdbus-codegen` with no arguments would exit
successfully with no output. While technically correct, that seems
unhelpful.

Require at least one interface file to be specified, so the user gets an
error message if they don’t specify any.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
Philip Withnall 2019-12-02 14:08:48 +00:00
parent 921e6d1245
commit 8f4155c124

View File

@ -149,7 +149,7 @@ def apply_annotations(iface_list, annotation_list):
def codegen_main():
arg_parser = argparse.ArgumentParser(description='D-Bus code and documentation generator')
arg_parser.add_argument('files', metavar='FILE', nargs='*',
arg_parser.add_argument('files', metavar='FILE', nargs='+',
help='D-Bus introspection XML file')
arg_parser.add_argument('--xml-files', metavar='FILE', action='append', default=[],
help=argparse.SUPPRESS)