kiekus/rp-filter

21 lines
313 B
Bash
Executable File

#!/bin/sh
set -e
usage() {
echo "usage: $0 [-h] [NAME=FUNC...]" >&2
}
while getopts h opt; do
case "$opt" in
h) usage; exit 0;;
?) usage; exit 255;;
esac
done
shift $(($OPTIND-1))
cond='false'
for arg; do
cond="$cond or (.[\"${arg%%=*}\"] ${arg#*=})"
done
exec jq -M -c "select($cond)"