summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRory Dudley2024-02-17 19:27:17 -0700
committerRory Dudley2024-02-17 19:27:17 -0700
commit0c01a478fa57cbd0c4e7836d1b4e697014da4d67 (patch)
tree4e7fbcf75bc2855ae5486852c390bef209a5a0bd /src
parent22645fe49fcf488b46fbbcfae7d189c5c9c8c350 (diff)
downloaddwarvish-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.
Diffstat (limited to 'src')
-rw-r--r--src/main.rs5
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(_) => {}