From ec2290c9f842a556eb68ab47e16a191741bab768 Mon Sep 17 00:00:00 2001 From: Yannic Date: Mon, 9 Dec 2019 22:42:35 +0100 Subject: [PATCH] Add --_opt flag for all built-in generators Plugins (and some built-in generators) have `--_opt` flag that allows passing parameters one-by-one instead of passing them as `--_out=:`. This PR changes protoc to allow using `--_opt` for all (built-in) generators. --- src/google/protobuf/compiler/main.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/google/protobuf/compiler/main.cc b/src/google/protobuf/compiler/main.cc index b723b14abf054..5239e09313fa7 100644 --- a/src/google/protobuf/compiler/main.cc +++ b/src/google/protobuf/compiler/main.cc @@ -69,17 +69,17 @@ int ProtobufMain(int argc, char* argv[]) { // Proto2 Python python::Generator py_generator; - cli.RegisterGenerator("--python_out", &py_generator, + cli.RegisterGenerator("--python_out", "--python_opt", &py_generator, "Generate Python source file."); // PHP php::Generator php_generator; - cli.RegisterGenerator("--php_out", &php_generator, + cli.RegisterGenerator("--php_out", "--php_opt", &php_generator, "Generate PHP source file."); // Ruby ruby::Generator rb_generator; - cli.RegisterGenerator("--ruby_out", &rb_generator, + cli.RegisterGenerator("--ruby_out", "--ruby_opt", &rb_generator, "Generate Ruby source file."); // CSharp @@ -94,7 +94,7 @@ int ProtobufMain(int argc, char* argv[]) { // JavaScript js::Generator js_generator; - cli.RegisterGenerator("--js_out", &js_generator, + cli.RegisterGenerator("--js_out", "--js_opt", &js_generator, "Generate JavaScript source."); return cli.Run(argc, argv);