diff --git a/src/benchmarks/network.rs b/src/benchmarks/network.rs index 99d3b93..8973008 100644 --- a/src/benchmarks/network.rs +++ b/src/benchmarks/network.rs @@ -4,12 +4,12 @@ use std::{fs,process}; use crate::text; // ping a host -pub fn ping_host(host: &str, count: &u16) { - println!("Pinging host {}, {} times.", host, count); +pub fn ping_host(address: &str, count: &u16) { + println!("Pinging host {}, {} times.", address, count); // run the ping command let output = process::Command::new("ping") - .arg(host) + .arg(address) .arg(format!("-c {}", count)) .output() .expect("Failed to execute command"); diff --git a/src/main.rs b/src/main.rs index 7ead235..d79c191 100644 --- a/src/main.rs +++ b/src/main.rs @@ -102,8 +102,8 @@ enum NetCommands { // ping subcommand #[clap(name = "ping", about = "Ping a host to determine network latency.")] Ping { - #[clap(short = 't', long, default_value_t = String::from("8.8.8.8"))] - host: String, + #[clap(short = 'a', long, default_value_t = String::from("8.8.8.8"))] + address: String, #[clap(short = 'c', long, default_value_t = 30)] count: u16, }, @@ -155,10 +155,10 @@ fn main() { } Commands::Net(args) => match &args.net_commands { - NetCommands::Ping { host, count } => { + NetCommands::Ping { address, count } => { for i in 0..cli.loopcount { println!("Test run number {}.", i + 1); - benchmarks::network::ping_host(host, count); + benchmarks::network::ping_host(address, count); } }, NetCommands::Bandwidth { download, output } => {