1
0
Fork 0

Add some options

This commit is contained in:
Alex Kotov 2020-12-30 01:34:55 +05:00
parent 42558c521f
commit 753cd0f58f
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08

View file

@ -7,10 +7,34 @@ const CRATE_NAME: &str = env!("CARGO_PKG_NAME");
struct Options {
#[clap(about = "The name or IP address of the destination host")]
host: String,
#[clap(
short = 'f',
long = "first",
default_value = "1",
about = "With what TTL to start",
)]
first_ttl: u8,
#[clap(
short = 'm',
long = "max-hops",
default_value = "30",
about = "The maximum number of hops to probe",
)]
max_ttl: u8,
#[clap(
short = 'q',
long = "queries",
default_value = "3",
about = "The number of probe packets per hop",
)]
nqueries: u32,
}
fn main() {
let options = Options::parse();
println!("host: {:?}", options.host);
println!("{:?}", options);
}