From df748f2971f41f7a70be3e5088828b3d68cf705e Mon Sep 17 00:00:00 2001 From: Kirill Lykov Date: Fri, 24 Feb 2023 13:45:30 +0100 Subject: [PATCH] some minor error messages corrections --- bench-tps/src/cli.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/bench-tps/src/cli.rs b/bench-tps/src/cli.rs index df3eeddd79a589..f5fde88434b18a 100644 --- a/bench-tps/src/cli.rs +++ b/bench-tps/src/cli.rs @@ -496,18 +496,22 @@ pub fn parse_args(matches: &ArgMatches) -> Result { args.multi_client = !matches.is_present("no-multi-client"); args.target_node = matches .value_of("target_node") - .map(|target_str| target_str.parse::().unwrap()); + .map(|target_str| target_str.parse::()) + .transpose() + .map_err(|_| "Failed to parse target-node")?; if let Some(v) = matches.value_of("num_lamports_per_account") { - args.num_lamports_per_account = - v.to_string().parse().map_err(|_| "can't parse lamports")?; + args.num_lamports_per_account = v + .to_string() + .parse() + .map_err(|_| "can't parse num-lamports-per-account")?; } if let Some(t) = matches.value_of("target_slots_per_epoch") { args.target_slots_per_epoch = t .to_string() .parse() - .map_err(|_| "can't parse target slots per epoch")?; + .map_err(|_| "can't parse target-slots-per-epoch")?; } if matches.is_present("use_randomized_compute_unit_price") { @@ -535,13 +539,13 @@ pub fn parse_args(matches: &ArgMatches) -> Result { if let Some(num_conflict_groups) = matches.value_of("num_conflict_groups") { let parsed_num_conflict_groups = num_conflict_groups .parse() - .map_err(|_| "Can't parse conflict groups")?; + .map_err(|_| "Can't parse num-conflict-groups")?; args.num_conflict_groups = Some(parsed_num_conflict_groups); } if let Some(addr) = matches.value_of("bind_address") { args.bind_address = - solana_net_utils::parse_host(addr).map_err(|_| "Failed to parse bind_address")?; + solana_net_utils::parse_host(addr).map_err(|_| "Failed to parse bind-address")?; } if let Some(client_node_id_filename) = matches.value_of("client_node_id") {