Simplify and Reused Code to Print ls Summary Line

This commit is contained in:
David A. Harding
2009-03-13 11:00:34 -04:00
parent ee59233c36
commit 448cecb91d

View File

@@ -581,13 +581,8 @@ case $action in
echo -e "$command" echo -e "$command"
if [ $TODOTXT_VERBOSE == 1 ]; then if [ $TODOTXT_VERBOSE == 1 ]; then
NUMTASKS=$( echo -e "$command" | wc -l | sed 's/ .*//' )
echo "--" echo "--"
NUMTASKS=$(
sed '/^$/d' "$src" \
| eval ${filter_command:-cat} \
| wc -l \
| sed 's/^[[:space:]]*\([0-9]*\).*/\1/' \
)
echo "TODO: $NUMTASKS of $LINES tasks shown from $src" echo "TODO: $NUMTASKS of $LINES tasks shown from $src"
fi fi