restore old watch() functionality
This commit is contained in:
parent
4b7102f5dc
commit
e56239957b
12
meow.sh
12
meow.sh
|
@ -34,7 +34,17 @@ scrape() {
|
||||||
TZ=UTC0 awk -v sep="$SEP" -f "$SRCDIR/scrape.awk"
|
TZ=UTC0 awk -v sep="$SEP" -f "$SRCDIR/scrape.awk"
|
||||||
}
|
}
|
||||||
|
|
||||||
watch() { # {search query} [regex...]
|
watch() { # {group name} [regex...]
|
||||||
|
declare -a regexes
|
||||||
|
local query="$1"
|
||||||
|
shift
|
||||||
|
for regex; do
|
||||||
|
regexes+=("^\[$query\].*$regex")
|
||||||
|
done
|
||||||
|
watchany "$query" "${regexes[@]}"
|
||||||
|
}
|
||||||
|
|
||||||
|
watchany() { # {search query} [regex...]
|
||||||
nullcheck "$1"
|
nullcheck "$1"
|
||||||
local gs="$(sanitize<<<"$1")" regex=
|
local gs="$(sanitize<<<"$1")" regex=
|
||||||
searchquery[$gs]="$1"
|
searchquery[$gs]="$1"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user