def METHOD_NAME(args):
    """ check if all jobs in all supplied PBS files have finished """
    options, job_list = args
    job_array = []
    for queue_file in job_list:
        job_array.append(load_json(queue_file))
    if options.wait == -1:
        try:
            while not_finished(job_array):
                time.sleep(5)
        except KeyboardInterrupt:
            return 'Keyboard Interrupt'
    elif options.wait:
        time_start = datetime.now()
        try:
            while (datetime.now() - time_start) < timedelta(seconds=options.wait):
                if not_finished(job_array):
                    time.sleep(5)
                else:
                    return 0
        except KeyboardInterrupt:
            return 'Keyboard Interrrupt'
        return 'Allotted time exceeded'
    else:
        if not_finished(job_array):
            return 'Jobs still running'
    return 0