Repository: google/flatbuffers
File: src/flatc_main.cpp (C++)

Code before:
  std::shared_ptr<flatbuffers::CodeGenerator> kotlin_generator =
      flatbuffers::NewKotlinCodeGenerator();

  std::shared_ptr<flatbuffers::CodeGenerator> lobster_generator =
      flatbuffers::NewLobsterCodeGenerator();

  std::shared_ptr<flatbuffers::CodeGenerator> php_generator =
      flatbuffers::NewPhpCodeGenerator();

  std::shared_ptr<flatbuffers::CodeGenerator> python_generator =
      flatbuffers::NewPythonCodeGenerator();

  std::shared_ptr<flatbuffers::CodeGenerator> rust_generator =
      flatbuffers::NewRustCodeGenerator();

  std::shared_ptr<flatbuffers::CodeGenerator> swift_generator =
      flatbuffers::NewSwiftCodeGenerator();

  std::shared_ptr<flatbuffers::CodeGenerator> ts_generator =
      flatbuffers::NewTsCodeGenerator();

  flatc.RegisterCodeGenerator(
      flatbuffers::FlatCOption{
          "b", "binary", "",
          "Generate wire format binaries for any data definitions" },
      binary_generator);

  flatc.RegisterCodeGenerator(
      flatbuffers::FlatCOption{ "c", "cpp", "",
                                "Generate C++ headers for tables/structs" },
      cpp_generator);

  flatc.RegisterCodeGenerator(
      flatbuffers::FlatCOption{ "n", "csharp", "",
                                "Generate C# classes for tables/structs" },
      csharp_generator);

  flatc.RegisterCodeGenerator(
      flatbuffers::FlatCOption{ "d", "dart", "",
                                "Generate Dart classes for tables/structs" },
      dart_generator);

  flatc.RegisterCodeGenerator(
      flatbuffers::FlatCOption{ "g", "go", "",
                                "Generate Go files for tables/structs" },
      go_generator);

  flatc.RegisterCodeGenerator(
      flatbuffers::FlatCOption{ "j", "java", "",
                                "Generate Java classes for tables/structs" },
      java_generator);

Review comment (suggestion):
since we aren't sharing the generators now, maybe just inline the `flatbuffers::New{LANG}Generator()` here.

Ditto for all the below generators.

Code after:
  flatc.RegisterCodeGenerator(
      flatbuffers::FlatCOption{ "g", "go", "",
                                "Generate Go files for tables/structs" },
      flatbuffers::NewGoCodeGenerator());

  flatc.RegisterCodeGenerator(
      flatbuffers::FlatCOption{ "j", "java", "",
                                "Generate Java classes for tables/structs" },
      flatbuffers::NewJavaCodeGenerator());

  flatc.RegisterCodeGenerator(
      flatbuffers::FlatCOption{ "", "jsonschema", "", "Generate Json schema" },
      flatbuffers::NewJsonSchemaCodeGenerator());

  flatc.RegisterCodeGenerator(
      flatbuffers::FlatCOption{ "", "kotlin", "",
                                "Generate Kotlin classes for tables/structs" },
      flatbuffers::NewKotlinCodeGenerator());

  flatc.RegisterCodeGenerator(
      flatbuffers::FlatCOption{ "", "lobster", "",
                                "Generate Lobster files for tables/structs" },
      flatbuffers::NewLobsterCodeGenerator());

  flatc.RegisterCodeGenerator(
      flatbuffers::FlatCOption{ "", "php", "",
                                "Generate PHP files for tables/structs" },
      flatbuffers::NewPhpCodeGenerator());

  flatc.RegisterCodeGenerator(
      flatbuffers::FlatCOption{ "p", "python", "",
                                "Generate Python files for tables/structs" },
      flatbuffers::NewPythonCodeGenerator());

  flatc.RegisterCodeGenerator(
      flatbuffers::FlatCOption{ "r", "rust", "",
                                "Generate Rust files for tables/structs" },
      flatbuffers::NewRustCodeGenerator());

  flatc.RegisterCodeGenerator(
      flatbuffers::FlatCOption{ "", "swift", "",
                                "Generate Swift files for tables/structs" },
      flatbuffers::NewSwiftCodeGenerator());

  flatc.RegisterCodeGenerator(
      flatbuffers::FlatCOption{ "T", "ts", "",
                                "Generate TypeScript code for tables/structs" },
      flatbuffers::NewTsCodeGenerator());

  // Create the FlatC options by parsing the command line arguments.
  const flatbuffers::FlatCOptions &options =