use clap::{command, Parser, Subcommand}; #[derive(Parser, Debug)] pub struct CliArgs { #[clap(subcommand)] pub command: Command, } #[derive(Clone, Debug, Subcommand)] pub enum Command { /// List all devices, where the manufacturer string contains the search key Search { /// The part that must be contained in the manufacturer name vendor_name: String, }, /// Talk to the device specified by the [`vendor_id`] and [`product_id`]. Send { usage_page: u16, usage_id: u16, message: u8, }, /// Talk to the device specified by the [`vendor_id`] and [`product_id`]. Monitor { usage_page: u16, usage_id: u16 }, Inform { #[command(subcommand)] command: Inform, }, ArrInform { values: Vec }, } #[derive(Subcommand, Clone, Debug)] pub enum Inform { Hex { val: String }, Dec { val: i64 }, Bin { val: String }, Char { val: char }, }