From 4bf00481948f805c2e1ccd705d92802e6b919521 Mon Sep 17 00:00:00 2001 From: Andrew Scherkus Date: Tue, 16 Jul 2019 13:14:28 -0400 Subject: [PATCH] Document --noremotedb flag for grpc_cli. It's surprising that grpc_cli always attempts to use the reflection service even when providing local proto files. Document the existence of a flag that surpresses this behavior. --- doc/command_line_tool.md | 6 ++++++ test/cpp/util/grpc_tool.cc | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/doc/command_line_tool.md b/doc/command_line_tool.md index a373cbea627..4f40481927e 100644 --- a/doc/command_line_tool.md +++ b/doc/command_line_tool.md @@ -70,6 +70,8 @@ guides for , [C++](https://github.com/grpc/grpc/blob/master/doc/server_reflection_tutorial.md) and [Go](https://github.com/grpc/grpc-go/blob/master/Documentation/server-reflection-tutorial.md) +Local proto files can be used as an alternative. See instructions [below](#Call-a-remote-method). + ## Usage ### List services @@ -185,6 +187,10 @@ We can send RPCs to a server and get responses using `grpc_cli call` command. If the proto file is not under the current directory, you can use `--proto_path` to specify a new search root. + Note that the tool will always attempt to use the reflection service first, + falling back to local proto files if the service is not found. Use + `--noremotedb` to avoid attempting to use the reflection service. + - Send non-proto rpc For using gRPC with protocols other than protobuf, you will need the exact diff --git a/test/cpp/util/grpc_tool.cc b/test/cpp/util/grpc_tool.cc index dbac31170f0..a425c2f4c04 100644 --- a/test/cpp/util/grpc_tool.cc +++ b/test/cpp/util/grpc_tool.cc @@ -469,6 +469,8 @@ bool GrpcTool::CallMethod(int argc, const char** argv, " fallback when parsing request/response\n" " --proto_path ; The search path of proto files, valid" " only when --protofiles is given\n" + " --noremotedb ; Don't attempt to use reflection service" + " at all\n" " --metadata ; The metadata to be sent to the server\n" " --infile ; Input filename (defaults to stdin)\n" " --outfile ; Output filename (defaults to stdout)\n" @@ -810,6 +812,8 @@ bool GrpcTool::ParseMessage(int argc, const char** argv, " fallback when parsing request/response\n" " --proto_path ; The search path of proto files, valid" " only when --protofiles is given\n" + " --noremotedb ; Don't attempt to use reflection service" + " at all\n" " --infile ; Input filename (defaults to stdin)\n" " --outfile ; Output filename (defaults to stdout)\n" " --binary_input ; Input in binary format\n"