def main()

in tools/stix-to-ecs/stix_to_ecs.py [0:0]


def main() -> None:
    options = get_options()
    if not options:
        exit(1)

    files = get_json_files(options.input, options.recursive)
    results = process_stix_files(files, options.provider)

    if not options.output and not options.elastic_info:
        print(json.dumps(flatten_list(results), indent=4))
        return

    if options.output:
        write_ecs_files(zip(files, results), options.output)

    if options.elastic_info:
        write_ecs_to_elastic(flatten_list(results), options.elastic_info)