summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@shack.(none)>2010-05-08 02:19:15 +0200
committerroot <root@shack.(none)>2010-05-08 02:19:15 +0200
commit82d487a0db225d35dd6bf4e0751508a9ab9bef9d (patch)
treec642a61be7cdc34a8a6e4eb546b7bd8b4fa1aada
parent9e24cf1941f87a294e5f9d212caac643ded27209 (diff)
Added builtin /unset
-rwxr-xr-xnoise16
1 files changed, 16 insertions, 0 deletions
diff --git a/noise b/noise
index 9d4f815f..dcef9f9e 100755
--- a/noise
+++ b/noise
@@ -39,6 +39,22 @@ noise_set() { # set a variable
esac
}
+noise_unset() { # unset a variable
+ case "$1" in
+ (-q|--quiet) echo=: ; shift ;;
+ (*) echo=echo ;;
+ esac
+ case $# in
+ (1) ##
+ unset "noise_$1"
+ sed -ni "/^$1=/!p" $env
+ ;;
+ (*)
+ fail "broken commandline: $@"
+ ;;
+ esac
+}
+
noise_quit() { # exit
echo "Good bye!"
exit