From 3f5c5026909af023c8a3885a4a3d97c669302c1b Mon Sep 17 00:00:00 2001 From: Mel Date: Fri, 1 Oct 2021 00:34:16 +0200 Subject: Global repository cursor --- cli/src/main.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'cli/src/main.rs') diff --git a/cli/src/main.rs b/cli/src/main.rs index 3b0203d..751871c 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -6,7 +6,8 @@ fn main() { let args: Vec = env::args().collect(); let command = args[1].as_str(); - let options = ActionOptions::from_pwd().expect("Could not get current path."); + let options = ActionOptions::from_path("./repo"); + //let options = ActionOptions::from_pwd().expect("Could not get current path."); match command { "create" => { @@ -16,11 +17,9 @@ fn main() { update(options).expect("Failed executing Update action."); } "shift" => { - let file_path = args[2].as_str(); + let new_cursor: usize = args[2].as_str().parse().expect("Invalid cursor."); - let new_cursor: usize = args[3].as_str().parse().expect("Invalid cursor."); - - shift(options, file_path, new_cursor).expect("Failed executing Shift actions."); + shift(options, new_cursor).expect("Failed executing Shift actions."); } _ => panic!("Unknown command: {}", command), } -- cgit 1.4.1