aboutsummaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rw-r--r--cli/src/main.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/cli/src/main.rs b/cli/src/main.rs
index 945da3a..3105f9a 100644
--- a/cli/src/main.rs
+++ b/cli/src/main.rs
@@ -1,23 +1,26 @@
use std::env;
-use ka::{create_command, shift_command, update_command};
+use ka::actions::{create, shift, update, ActionOptions};
fn main() {
let args: Vec<String> = env::args().collect();
let command = args[1].as_str();
+
+ let options = ActionOptions::from_pwd().expect("Could not get current path.");
+
match command {
"create" => {
- create_command().unwrap();
+ create(options).unwrap();
}
"update" => {
- update_command().unwrap();
+ update(options).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);
+ shift(options, file_path, new_cursor).unwrap();
}
_ => println!("Unknown command: {}", command),
}