use clap::{ArgAction, Parser}; #[derive(Parser, Debug)] #[command(name = "ping")] #[command(about = "A ping program")] #[command(disable_help_flag = true)] pub struct Args { /// Beep on each ping #[arg(short = 'a', long = "beep", action = ArgAction::SetTrue)] pub beep: bool, /// Number of ping to make #[arg(short = 'c', long = "count", value_name = "count")] pub count: Option, /// Interface to use #[arg(short = 'I', value_name = "interface")] pub interface: Option, /// number of milliseconds to wait between 2 pings #[arg(short = 'i', value_name = "milliseconds")] pub interval: Option, /// the Time-to-live #[arg(short = 't', long = "ttl", value_name = "TTL")] pub ttl: Option, /// Show the statistics #[arg(short = 's', long = "stats", action = ArgAction::SetTrue)] pub stats: bool, /// Print the legende line #[arg(short = 'l', long = "legende", action = ArgAction::SetTrue)] pub legende: bool, /// Print the status line, the given target and the IP the ping is send to. #[arg(long = "status", action = ArgAction::SetTrue)] pub status: bool, /// Default target, if none is specified #[arg(long = "default-target", value_name = "default_target")] pub default_target: Option, /// Target IP address #[arg(value_name = "target")] pub target: Option, }