From 02139a05dc928ac4fa27c7b794a859e42f3b0831 Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Mon, 15 Aug 2016 11:34:21 -0700 Subject: Add CliCredentials, config_grpc_cli.h --- test/cpp/util/grpc_cli.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'test/cpp/util/grpc_cli.cc') diff --git a/test/cpp/util/grpc_cli.cc b/test/cpp/util/grpc_cli.cc index 897ac5ce4a..fe248601ee 100644 --- a/test/cpp/util/grpc_cli.cc +++ b/test/cpp/util/grpc_cli.cc @@ -40,7 +40,7 @@ --protofiles=src/proto/grpc/testing/test.proto --enable_ssl=false Options: - 1. --protofiles, use this flag to provide a proto file if the server does + 1. --protofiles, use this flag to provide proto files if the server does does not have the reflection service. 2. --proto_path, if your proto file is not under current working directory, use this flag to provide a search root. It should work similar to the @@ -50,15 +50,17 @@ --metadata="MyHeaderKey1:Value1:MyHeaderKey2:Value2" 4. --enable_ssl, whether to use tls. 5. --use_auth, if set to true, attach a GoogleDefaultCredentials to the call - 6. --input_binary_file, a file containing the serialized request. The file - can be generated by calling something like: + 6. --infile, input filename (defaults to stdin) + 7. --outfile, output filename (defaults to stdout) + 8. --binary_input, use the serialized request as input. The serialized + request can be generated by calling something like: protoc --proto_path=src/proto/grpc/testing/ \ --encode=grpc.testing.SimpleRequest \ src/proto/grpc/testing/messages.proto \ < input.txt > input.bin If this is used and no proto file is provided in the argument list, the method string has to be exact in the form of /package.service/method. - 7. --output_binary_file, a file to write binary format response into, it can + 9. --binary_output, use binary format response as output, it can be later decoded using protoc: protoc --proto_path=src/proto/grpc/testing/ \ --decode=grpc.testing.SimpleResponse \ @@ -72,6 +74,7 @@ #include #include +#include "test/cpp/util/cli_credentials.h" #include "test/cpp/util/grpc_tool.h" #include "test/cpp/util/test_config.h" @@ -93,6 +96,6 @@ int main(int argc, char** argv) { grpc::testing::InitTest(&argc, &argv, true); return grpc::testing::GrpcToolMainLib( - argc, (const char**)argv, + argc, (const char**)argv, grpc::testing::CliCredentials(), std::bind(SimplePrint, FLAGS_outfile, std::placeholders::_1)); } -- cgit v1.2.3