Fix the shoot-screen() function
authorMikael Berthe <mikael@lilotux.net>
Wed, 04 Sep 2013 19:33:22 +0200
changeset 27 77e442e4e486
parent 26 73ef97dce631
child 28 aa674a9c97c2
Fix the shoot-screen() function s/exit/return/ since this function is to be called from an interactive shell.
zshrc.d/30-functions-shoot-screen.zrc
--- a/zshrc.d/30-functions-shoot-screen.zrc	Mon Aug 06 22:44:48 2012 +0200
+++ b/zshrc.d/30-functions-shoot-screen.zrc	Wed Sep 04 19:33:22 2013 +0200
@@ -23,8 +23,8 @@
 
     if (( usage != 0 )); then
         print "Usage: $0 [-h] [-p prefix] [-e extension] [-d delay]" >&2
-        if (( usage == 1 )); then exit 0; fi
-        exit -1
+        if (( usage == 1 )); then return 0; fi
+        return -1
     fi
 
     local n=0
@@ -42,7 +42,7 @@
         done
         print "\nCapture: $filename"
         import $filename
-        if [[ $? != 0 ]]; then exit $?; fi
+        if [[ $? != 0 ]]; then return $?; fi
         print
     done
 }