summary refs log tree commit diff stats
path: root/rust/qmk-hid-com/src/cli.rs
blob: afef1a9e7ed7f79cf58b37146b3e11f50001b1ef (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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<u8> },
}

#[derive(Subcommand, Clone, Debug)]
pub enum Inform {
    Hex { val: String },
    Dec { val: i64 },
    Bin { val: String },
    Char { val: char },
}