]> git.saurik.com Git - cycript.git/blobdiff - Filter.sh
Refactor CYSetLast to return a reference to the eol.
[cycript.git] / Filter.sh
index 7135d28414c0362a08a405ccc5034f9f6827b93a..bb76b0ad81711373c6d193ef97ee19ba9e478679 100755 (executable)
--- a/Filter.sh
+++ b/Filter.sh
@@ -3,7 +3,14 @@
 filters=("$@")
 
 while IFS= read -r line; do
-    if [[ ${line} = @begin* ]]; then
+    if [[ ${line} = @if* ]]; then
+        line=${line#@if }
+        for name in "${filters[@]}"; do
+            if [[ ${line} = ${name}' '* ]]; then
+                echo "${line#${name} }"
+            fi
+        done
+    elif [[ ${line} = @begin* ]]; then
         set ${line}; shift
         filter=
         for name in "${filters[@]}"; do