Skip to content

Commit

Permalink
Implement unalias
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuichiueda committed Dec 22, 2024
1 parent 4b9bd1d commit 8cb629b
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/core/builtins/alias.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,8 @@ pub fn unalias(core: &mut ShellCore, args: &mut Vec<String>) -> i32 {
return 0;
}

for alias in &mut args[1..] {
dbg!("{:?}", &alias);
core.db.aliases.remove_entry(alias);
}

/*
if args.len() == 2 && args[1].find("=") != None {
let kv: Vec<String> = args[1].split("=").map(|t| t.to_string()).collect();
core.db.aliases.insert(kv[0].clone(), kv[1..].join("="));
}*/
args[1..].iter()
.for_each(|e| {core.db.aliases.remove_entry(e);} );

0
}
Expand Down

0 comments on commit 8cb629b

Please sign in to comment.