Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
clap 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
str4d authored and stepancheg committed Feb 21, 2022
1 parent 13e30fe commit 9ba0d9d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion interop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ protobuf = "2.23"
futures = "0.3.*"
tls-api = "0.6.0"
chrono = "0.4"
clap = "2.20.0"
clap = "3.1"

[lib]
test = false
Expand Down
23 changes: 11 additions & 12 deletions interop/src/bin/interop_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,26 @@ use grpc::prelude::*;
use grpc_interop::interop_client;
use grpc_interop::test_grpc::TestServiceClient;

use clap::App;
use clap::Arg;
use clap::{Arg, Command};
use grpc_interop::DEFAULT_PORT;

// The flags we use are defined in the gRPC Interopability doc
// https://github.com/grpc/grpc/blob/master/doc/interop-test-descriptions.md
fn main() {
env_logger::init();

let options = App::new("gRPC interopability client")
let options = Command::new("gRPC interopability client")
.version("0.1")
.author("Steve Jenson <[email protected]>")
.about("Interoperability Test Client for grpc-rust")
.arg(
Arg::with_name("server_host")
Arg::new("server_host")
.long("server_host")
.help("The server host to connect to. For example, \"localhost\" or \"127.0.0.1\"")
.takes_value(true),
)
.arg(
Arg::with_name("server_host_override")
Arg::new("server_host_override")
.long("server_host_override")
.help(
"The server host to claim to be connecting to, for use in TLS and HTTP/2 \
Expand All @@ -31,43 +30,43 @@ fn main() {
.takes_value(true),
)
.arg(
Arg::with_name("server_port")
Arg::new("server_port")
.long("server_port")
.help("The server port to connect to. For example, \"8080\"")
.takes_value(true),
)
.arg(
Arg::with_name("test_case")
Arg::new("test_case")
.long("test_case")
.help("The name of the test case to execute. For example, \"empty_unary\"")
.takes_value(true),
)
.arg(
Arg::with_name("use_tls") // boolean
Arg::new("use_tls") // boolean
.long("use_tls")
.help("Whether to use a plaintext or encrypted connection")
.takes_value(true),
)
.arg(
Arg::with_name("use_test_ca")
Arg::new("use_test_ca")
.long("use_test_ca")
.help("Whether to replace platform root CAs with ca.pem as the CA root")
.takes_value(true),
)
.arg(
Arg::with_name("default_service_account")
Arg::new("default_service_account")
.long("default_service_account")
.help("Email of the GCE default service account.")
.takes_value(true),
)
.arg(
Arg::with_name("oauth_scope")
Arg::new("oauth_scope")
.long("oauth_scope")
.help("OAuth scope. For example, \"https://www.googleapis.com/auth/xapi.zoo\"")
.takes_value(true),
)
.arg(
Arg::with_name("service_account_key_file")
Arg::new("service_account_key_file")
.long("service_account_key_file")
.help(
"The path to the service account JSON key file generated from GCE developer \
Expand Down

0 comments on commit 9ba0d9d

Please sign in to comment.