improve
authorJoerg Jaspert <joerg@debian.org>
Fri, 22 Mar 2013 20:23:02 +0000 (21:23 +0100)
committerJoerg Jaspert <joerg@debian.org>
Fri, 22 Mar 2013 20:23:02 +0000 (21:23 +0100)
.zsh/30_Options.zsh
.zsh/install.zsh

index 87e1a13..4fa1a9d 100644 (file)
@@ -15,15 +15,7 @@ function UnsetOPT() {
 function SetOPTifExists() {
        local option=${(L)1//_/} # lowercase and no '_'
 
-       case "$option" in
-               "no"*)
-                       option=${option/no/}
-                       # resets $1 and $2
-                       set $option off
-                       ;;
-       esac
-
-       if ( echo ${(k)options} | grep $option >/dev/null ); then
+    if [[ -n ${options[$option]} ]]; then
                # option exists, set it.
                case "$2" in
                        on)
index 2d3d7dd..6e71940 100644 (file)
@@ -1,6 +1,6 @@
 # -*- sh -*-
 
-autoload colors ; colors
+autoload -U colors ; colors
 
 # Install or update my ZSH config on a remote host.
 # Needs Git and makeself locally