use clap::Parser;
#[derive(Parser, Debug)]
#[command(
name = "iwconf",
about = "Colorful iwconfig-style WLAN control for Windows",
long_about = None,
styles = clap_color_help::default_styles(),
arg_required_else_help = false,
)]
pub struct Cli {
#[arg(short = 'i', long = "iface", value_name = "NAME|PATTERN", global = true)]
pub iface: Option<String>,
#[arg(long = "regex", requires = "iface", global = true)]
pub regex: bool,
#[arg(short = 's', long = "scan")]
pub scan: bool,
#[arg(long = "rescan")]
pub rescan: bool,
#[arg(long = "essid", value_name = "SSID")]
pub essid: Option<String>,
#[arg(long = "key", value_name = "PASSPHRASE", requires = "essid")]
pub key: Option<String>,
#[arg(long = "profile", value_name = "PROFILE", conflicts_with = "key")]
pub profile: Option<String>,
#[arg(short = 'd', long = "disconnect")]
pub disconnect: bool,
#[arg(long = "timeout", value_name = "SECS")]
pub timeout: Option<u64>,
#[arg(long = "no-color", global = true)]
pub no_color: bool,
#[arg(long = "no-emoji", global = true)]
pub no_emoji: bool,
#[arg(long = "plain", global = true)]
pub plain: bool,
#[arg(long = "json", global = true)]
pub json: bool,
}
impl Cli {
pub fn is_action(&self) -> bool {
self.essid.is_some() || self.disconnect
}
}