summary refs log tree commit diff stats
path: root/rust/qmk-hid-com/src/cli.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust/qmk-hid-com/src/cli.rs')
-rw-r--r--rust/qmk-hid-com/src/cli.rs40
1 files changed, 40 insertions, 0 deletions
diff --git a/rust/qmk-hid-com/src/cli.rs b/rust/qmk-hid-com/src/cli.rs
new file mode 100644
index 0000000..afef1a9
--- /dev/null
+++ b/rust/qmk-hid-com/src/cli.rs
@@ -0,0 +1,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 },
+}