about summary refs log tree commit diff
path: root/cli/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/src/main.rs')
-rw-r--r--cli/src/main.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/cli/src/main.rs b/cli/src/main.rs
new file mode 100644
index 0000000..945da3a
--- /dev/null
+++ b/cli/src/main.rs
@@ -0,0 +1,24 @@
+use std::env;
+
+use ka::{create_command, shift_command, update_command};
+
+fn main() {
+    let args: Vec<String> = env::args().collect();
+    let command = args[1].as_str();
+    match command {
+        "create" => {
+            create_command().unwrap();
+        }
+        "update" => {
+            update_command().unwrap();
+        }
+        "shift" => {
+            let file_path = args[2].as_str();
+
+            let new_cursor: usize = args[3].as_str().parse().expect("Invalid cursor.");
+
+            shift_command(file_path, new_cursor);
+        }
+        _ => println!("Unknown command: {}", command),
+    }
+}