Add some options
This commit is contained in:
parent
42558c521f
commit
753cd0f58f
1 changed files with 25 additions and 1 deletions
26
src/main.rs
26
src/main.rs
|
@ -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);
|
||||
}
|
||||
|
|
Reference in a new issue