rusty-ping 0.1.0

A pretty ping/ICMP utility
use clap::{ArgAction, Parser};

#[derive(Parser, Debug)]
#[command(name = "ping")]
#[command(about = "A ping program")]
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<u32>,

    /// Interface to use
    #[arg(short = 'I', value_name = "interface")]
    pub interface: Option<String>,

    /// The number of milliseconds to wait between 2 pings
    #[arg(short = 'i', value_name = "milliseconds")]
    pub interval: Option<u32>,

    /// the Time-to-live
    #[arg(short = 't', long = "ttl", value_name = "TTL")]
    pub ttl: Option<u32>,

    /// Show the statistics
    #[arg(short = 's', long = "stats", action = ArgAction::SetTrue)]
    pub stats: bool,

    /// Print the legend line
    #[arg(short = 'l', long = "legend", action = ArgAction::SetTrue)]
    pub legend: bool,

    /// Print the status line, the given target and the IP the ping is send to.
    #[arg(short = 'S', 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<String>,

    /// Target IP address
    #[arg(value_name = "target")]
    pub target: Option<String>,
}