def METHOD_NAME():
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument(
        "--format",
        required=True,
        choices=(
            "ftmodule.h",
            "main-modules",
            "aux-modules",
            "base-extensions-list",
        ),
        help="Select output format.",
    )
    parser.add_argument(
        "input",
        metavar="CONFIGURE_RAW",
        help="The input configure.raw file to parse.",
    )
    parser.add_argument("--output", help="Output file (default is stdout).")
    args = parser.parse_args()
    with open(args.input) as f:
        input_data = f.read()
    lists = parse_modules_cfg(input_data)
    if args.format == "ftmodule.h":
        result = generate_ftmodule(lists)
    elif args.format == "main-modules":
        result = generate_main_modules(lists)
    elif args.format == "aux-modules":
        result = generate_aux_modules(lists)
    elif args.format == "base-extensions-list":
        result = generate_base_extensions(lists)
    else:
        assert False, "Invalid output format!"
    if args.output:
        with open(args.output, "w") as f:
            f.write(result)
    else:
        print(result)
    return 0