]> git.saurik.com Git - cycript.git/blobdiff - Filter.sh
Universal binary!
[cycript.git] / Filter.sh
index 00dc10c89e4bf99a877fc3ce06bf5374a8892cc3..bb76b0ad81711373c6d193ef97ee19ba9e478679 100755 (executable)
--- a/Filter.sh
+++ b/Filter.sh
@@ -1,9 +1,16 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 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