Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: allopts



This function was added in 3.1.5-pws-8 after one of the longest discussion
threads in zsh-users history.  And I just now noticed that Peter broke it
by adding that "emulate" command, which resets some of the options that the
function is supposed to report!

There are also a couple of unnecessary semicolons and a completely useless
use of &&, which have been there since the zsh-users posted version.

Index: Functions/Misc/allopt
===================================================================
@@ -8,17 +8,16 @@
 # Written by Sweth Chandramouli with hacks by Bart Schaefer.
 
 listalloptions () {
-   emulate -R zsh
    builtin setopt localoptions kshoptionprint
    local OPT_NAME OPT_PAIR OPT_VALUE
    for OPT_PAIR in "${(f)$(builtin setopt)}" ; do
       OPT_VALUE=${OPT_PAIR##* }
       OPT_NAME=${OPT_PAIR%% *}
       if [[ ${OPT_NAME#no} != ${OPT_NAME} ]] ; then
-         OPT_VALUE=${(L)${${OPT_VALUE:s/on/OFF}:s/off/on}} &&
-            OPT_NAME=${OPT_NAME#no};
-      fi;
-      echo ${(r:21:)OPT_NAME} ${OPT_VALUE}
+	 OPT_VALUE=${(L)${${OPT_VALUE:s/on/OFF}:s/off/on}}
+	 OPT_NAME=${OPT_NAME#no}
+      fi
+      echo "${(r:21:)OPT_NAME} ${OPT_VALUE}"
    done
 }
 

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author