Make sure grmlzshrc is only loaded once
[grml-etc-core.git] / etc / zsh / zshrc
index 9cdb7d2..f9d51b2 100644 (file)
 #   *all* aliases, for example, use @@INSERT-aliases-all@@.
 #}}}
 
+# Only load once
+[[ ${(t)GRML} != *association* ]] && typeset -gA GRML
+if (( ${GRML[ZSHRC_LOADED]} )); then
+    return 0
+else
+    GRML[ZSHRC_LOADED]=1
+fi
+
 # zsh profiling {{{
 # just execute 'ZSH_PROFILE_RC=1 zsh' and run 'zprof' to get the details
 if [[ $ZSH_PROFILE_RC -gt 0 ]] ; then
@@ -3741,6 +3749,7 @@ selhist() {
 }
 
 # Usage: simple-extract <file>
+# Using option -d deletes the original archive file.
 #f5# Smart archive extractor
 simple-extract() {
     emulate -L zsh
@@ -3818,7 +3827,7 @@ simple-extract() {
         esac
 
         if ! check_com ${DECOMP_CMD[(w)1]}; then
-            echo "ERROR: ${DECOMP_CMD[(w)1]} not installed !" >&2
+            echo "ERROR: ${DECOMP_CMD[(w)1]} not installed." >&2
             RC=$((RC+2))
             continue
         fi
@@ -3856,8 +3865,10 @@ simple-extract() {
             if $USES_STDIN; then
                 if $USES_STDOUT; then
                     ${=WGET_CMD} "$ARCHIVE" | ${=DECOMP_CMD} > $GZTARGET
+                    RC=$((RC+$?))
                 else
                     ${=WGET_CMD} "$ARCHIVE" | ${=DECOMP_CMD}
+                    RC=$((RC+$?))
                 fi
             else
                 if $USES_STDOUT; then
@@ -3868,7 +3879,7 @@ simple-extract() {
             fi
 
         else
-            print "ERROR: '$ARCHIVE' is neither a valid file nor a supported URI" >&2
+            print "ERROR: '$ARCHIVE' is neither a valid file nor a supported URI." >&2
             RC=$((RC+8))
         fi
     done