]> git.netwichtig.de Git - user/henk/vcsh/zsh.git/commitdiff
Add experimental 'with' function
authorHendrik Jaeger <git-commit@henk.geekmail.org>
Fri, 14 Sep 2018 21:23:08 +0000 (23:23 +0200)
committerHendrik Jaeger <git-commit@henk.geekmail.org>
Fri, 14 Sep 2018 21:23:08 +0000 (23:23 +0200)
.zsh_functions

index feb061655ad2dab7b8aa6311e11d579a88791f77..181d4ba6b3d7495e089b6e58f3391ebba3875025 100644 (file)
@@ -67,3 +67,12 @@ function henkspngpostproc () {
         pngnq -f -d resized/pngnqed -e .png resized/$img
     done
 }
+
+function with () {
+    local prefix="$* " str compcontext=normal:normal:_normal
+    while :
+    do
+      str=$prefix
+      vared str && eval $str
+    done
+}