use clap::{Parser, ArgAction}; #[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 seconds to wait between 2 pings #[arg(short = 'i', value_name = "seconds")] pub seconds: 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 Help line #[arg(short = 'H', action = ArgAction::Help, required = false)] pub help: Option, /// Print the remainder line #[arg(short = 'l', long = "remainder", action = ArgAction::SetTrue)] pub remainder: bool, /// Target IP address #[arg(value_name = "target")] pub target: Option, }