def get_output_name(args):
    """Get the name of the file to output to."""
    output_name = args.output_name
    if output_name is not None:
        return output_name
    input_name = args.file_name
    base = input_name.rsplit('.', 1)[0]
    return '{}.json'.format(base)