) | cut -d/ -f2- | sort
}
+[ "$FILTER" ] && list_fex="$(
+ fex='p'
+ STRING "$FILTER^" \
+ | sed -r 's;\^;\n;g; s;[]\/\(\)\\\^\$\?\.\+\*\;\[\{\}];\\&;g' \
+ | while read -r f; do
+ [ ! "${f#~}" ] && continue
+ [ "${f#~}" = "$f" ] \
+ && fex="/(\ttags=([^\t]*,)?)(${f})((,[^\t]*)?\t)/{${fex}}" \
+ || fex="/(\ttags=([^\t]*,)?)(${f#~})((,[^\t]*)?\t)/d; ${fex}"
+ printf '%s\n' "${fex}"
+ done \
+ | tail -n1
+)"
+
list_filemeta(){
local meta base f fn file
base="$1"
meta="$1/.index/meta"
meta_dir "$_DATA/$ITEM/$base"
- grep -iE "$(STRING "${SEARCH}")" "$_DATA/$ITEM/$meta" \
- | cut -f1,6- \
+ if [ "$FILTER" ]; then
+ sed -nr "$list_fex" "$_DATA/$ITEM/$meta"
+ elif [ "${SEARCH#!}" != "${SEARCH}" ]; then
+ grep -viE "$(STRING "${SEARCH#!}")" "$_DATA/$ITEM/$meta"
+ else
+ grep -iE "$(STRING "${SEARCH}")" "$_DATA/$ITEM/$meta"
+ fi |cut -f1,6- \
| while f="$(line)"; do
fn="$(UNSTRING "${f#* }")"; fn="${fn%${CR}}";
file="$(printf '%s\n' "$_DATA/$ITEM/$base/${fn}".*)"