Implement pre and post filters in _list

This commit is contained in:
Ed Blackman
2009-03-13 18:17:16 -04:00
parent cf3c5312bf
commit 9ab77253db

View File

@@ -362,12 +362,19 @@ _list() {
## Get our search arguments, if any
shift ## was file name, new $1 is first search term
filter_command="${prefilter_command:-}"
for search_term in "$@"
do
filter_command="${filter_command:-} ${filter_command:+|} \
grep -i \"$search_term\" "
done
[ -n "$postfilter_command" ] && {
filter_command="${filter_command:-}${filter_command:+ | }${postfilter_command:-}"
}
## Figure out how much padding we need to use
## We need one level of padding for each power of 10 $LINES uses
LINES=$( wc -l "$src" | sed 's/ .*//' )