forked from extern/nushell
Add the ability to remove and list aliases (#3879)
* Add the ability to remove and list aliases * Fix failing unit tests * Add a test to check unalias shadowing blocks
This commit is contained in:
@ -407,6 +407,12 @@ impl ParserScope for Scope {
|
||||
}
|
||||
}
|
||||
|
||||
fn remove_alias(&self, name: &str) {
|
||||
for frame in self.frames.lock().iter_mut().rev() {
|
||||
frame.aliases.remove(name);
|
||||
}
|
||||
}
|
||||
|
||||
fn enter_scope(&self) {
|
||||
self.frames.lock().push(ScopeFrame::new());
|
||||
}
|
||||
|
Reference in New Issue
Block a user