glib-mkenums: require at least one input file

Previously, the behaviour if you supplied no input files was to crash:

    Traceback (most recent call last):
      File "/usr/bin/glib-mkenums", line 420, in <module>
        base = os.path.basename(options.args[0])
    IndexError: list index out of range

While in theory you might want to supply no input files, it is much more
likely to be a misconfiguration of the build process. Since this has
never worked, let's make that explicit:

    glib-mkenums: error: the following arguments are required: args
This commit is contained in:
Will Thompson 2018-06-25 09:33:01 +01:00
parent a93ecc2004
commit 4cf60ececf
No known key found for this signature in database
GPG Key ID: 3422DC0D7AD482A7

View File

@ -325,7 +325,7 @@ parser.add_argument('--template', default='', dest='template',
parser.add_argument('--output', default=None, dest='output')
parser.add_argument('--version', '-v', default=False, action='store_true', dest='version',
help='Print version informations')
parser.add_argument('args', nargs='*')
parser.add_argument('args', nargs='+')
options = parser.parse_args()