use clap::{Parser, Subcommand, ValueEnum};
#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
pub struct Args {
#[command(subcommand)]
pub action: Action,
}
#[derive(Debug, Clone, Copy, ValueEnum, Default)]
pub enum DeviceType {
#[default]
All,
Usb,
Bluetooth,
}
#[derive(Subcommand, Debug)]
pub enum Action {
#[command(about = "Watch for keyboard connections and switch profiles")]
Watch {
#[arg(short, long, help = "USB keyboard product ID")]
keyboard_id: Option<u16>,
#[arg(
short,
long,
help = "Karabiner-Elements profile name for external keyboard"
)]
product_profile: Option<String>,
#[arg(short, long, help = "Default Karabiner-Elements profile name")]
default_profile: Option<String>,
#[arg(short, long, help = "Enable verbose/debug logging")]
verbose: bool,
},
#[command(about = "List available USB and Bluetooth devices")]
Check {
#[arg(
short = 't',
long = "type",
value_enum,
default_value = "all",
help = "Device type to list"
)]
device_type: DeviceType,
},
}