From 0c01a478fa57cbd0c4e7836d1b4e697014da4d67 Mon Sep 17 00:00:00 2001 From: Rory Dudley Date: Sat, 17 Feb 2024 19:27:17 -0700 Subject: Update cd Instead of printing an error if the path is not specified, simply 'cd' into the user's home directory instead. --- src/main.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 1ff551c..322381c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -61,10 +61,7 @@ fn eval(paths: &[&str], prompt: &str) { if cmd == "cd" { let path = match args.first() { Some(str) => str, - None => { - println!("cd: Must specify a path"); - continue; - } + None => env!("HOME"), }; match std::env::set_current_dir(path) { Ok(_) => {} -- cgit v1.2.3