From 9ab77253db7ef4fb0678658cfe61956daa772e0d Mon Sep 17 00:00:00 2001 From: Ed Blackman Date: Fri, 13 Mar 2009 18:17:16 -0400 Subject: [PATCH] Implement pre and post filters in _list --- todo.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/todo.sh b/todo.sh index a8025b4..b9298f0 100755 --- a/todo.sh +++ b/todo.sh @@ -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/ .*//' )