diff options
author | Rory Dudley | 2024-03-30 20:22:47 -0600 |
---|---|---|
committer | Rory Dudley | 2024-03-30 20:22:47 -0600 |
commit | b02576d3a00f182394be4bc41a26de50e4b64078 (patch) | |
tree | 2aca2f0729e9ecafd4857d1cf203f0a8857e3237 /src/poem/anthology.rs | |
parent | 2439f63a1c0859fd454d4a67dc36b61ad6ab5eb8 (diff) | |
download | dwarvish-b02576d3a00f182394be4bc41a26de50e4b64078.tar.gz |
Add the 'unset' built-in command
Add the 'unset' command to remove global environment variable
definitions from the shell.
Diffstat (limited to 'src/poem/anthology.rs')
-rw-r--r-- | src/poem/anthology.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/poem/anthology.rs b/src/poem/anthology.rs index 94b5f6b..2a2f62a 100644 --- a/src/poem/anthology.rs +++ b/src/poem/anthology.rs @@ -7,7 +7,9 @@ use crate::compose::Environment; use crate::poem::Verse; /// A static list of all the built-in commands -static INDEX: [&str; 6] = ["alias", "cd", "exit", "export", "source", "unalias"]; +static INDEX: [&str; 7] = [ + "alias", "cd", "exit", "export", "source", "unalias", "unset", +]; /// Lookup the index of a built-in command /// @@ -30,6 +32,7 @@ pub fn incant(verse: &Verse, index: usize, env: &mut Environment) -> i32 { "export" => export::incant(verse), "source" => source::incant(verse, env), "unalias" => alias::unincant(verse, &mut env.aliases), + "unset" => export::unincant(verse), _ => unreachable!(), } } |