diff options
author | Rory Dudley | 2024-02-17 19:27:17 -0700 |
---|---|---|
committer | Rory Dudley | 2024-02-17 19:27:17 -0700 |
commit | 0c01a478fa57cbd0c4e7836d1b4e697014da4d67 (patch) | |
tree | 4e7fbcf75bc2855ae5486852c390bef209a5a0bd | |
parent | 22645fe49fcf488b46fbbcfae7d189c5c9c8c350 (diff) | |
download | dwarvish-0c01a478fa57cbd0c4e7836d1b4e697014da4d67.tar.gz |
Update cd
Instead of printing an error if the path is not specified, simply 'cd'
into the user's home directory instead.
-rw-r--r-- | src/main.rs | 5 |
1 files changed, 1 insertions, 4 deletions
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(_) => {} |