Simplified check for done task.

Use simple comparison with slice of string (already used e.g. in _list()) instead of grep -c pipeline.
This commit is contained in:
Ingo Karkat
2011-05-12 14:17:05 +02:00
parent dae6f2bcaf
commit 99dc4dce9f

View File

@@ -953,7 +953,7 @@ case $action in
[ -z "$todo" ] && die "TODO: No task $item." [ -z "$todo" ] && die "TODO: No task $item."
# Check if this item has already been done # Check if this item has already been done
if [ `echo $todo | grep -c "^x "` -eq 0 ] ; then if [ "${todo:0:2}" != "x " ]; then
now=`date '+%Y-%m-%d'` now=`date '+%Y-%m-%d'`
# remove priority once item is done # remove priority once item is done
sed -i.bak $item"s/^(.) //" "$TODO_FILE" sed -i.bak $item"s/^(.) //" "$TODO_FILE"