Tab fixes.

This commit is contained in:
Jared Cordasco
2010-04-13 23:36:31 +08:00
committed by Gina Trapani
parent e395ac78d8
commit a4ab8a808a

38
todo.sh
View File

@@ -262,7 +262,7 @@ cleaninput()
action_regexp="^\(append\|app\|prepend\|prep\|replace\)$" action_regexp="^\(append\|app\|prepend\|prep\|replace\)$"
# Check which action we are being used in as this affects what cleaning we do # Check which action we are being used in as this affects what cleaning we do
if [ `echo $action | grep -c $action_regexp` -eq 1 ]; then if [ `echo $action | grep -c $action_regexp` -eq 1 ]; then
# These actions use sed and & as the matched string so escape it # These actions use sed and & as the matched string so escape it
input=`echo $input | sed 's/\&/\\\&/g'` input=`echo $input | sed 's/\&/\\\&/g'`
fi fi
@@ -772,26 +772,26 @@ case $action in
# Split multiple do's, if comma seperated change to whitespace sepereated # Split multiple do's, if comma seperated change to whitespace sepereated
# Loop the 'do' function for each item # Loop the 'do' function for each item
for item in `echo $* | tr ',' ' '`; do for item in `echo $* | tr ',' ' '`; do
[ -z "$item" ] && die "$errmsg" [ -z "$item" ] && die "$errmsg"
[[ "$item" = +([0-9]) ]] || die "$errmsg" [[ "$item" = +([0-9]) ]] || die "$errmsg"
todo=$(sed "$item!d" "$TODO_FILE") todo=$(sed "$item!d" "$TODO_FILE")
[ -z "$todo" ] && die "$item: No such todo." [ -z "$todo" ] && die "$item: No such todo."
# 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 [ `echo $todo | grep -c "^x "` -eq 0 ] ; 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"
sed -i.bak $item"s|^|&x $now |" "$TODO_FILE" sed -i.bak $item"s|^|&x $now |" "$TODO_FILE"
[ $TODOTXT_VERBOSE -gt 0 ] && { [ $TODOTXT_VERBOSE -gt 0 ] && {
newtodo=$(sed "$item!d" "$TODO_FILE") newtodo=$(sed "$item!d" "$TODO_FILE")
echo "$item: $newtodo" echo "$item: $newtodo"
echo "TODO: $item marked as done." echo "TODO: $item marked as done."
} }
else else
echo "$item is already marked done" echo "$item is already marked done"
fi fi
done done
if [ $TODOTXT_AUTO_ARCHIVE = 1 ]; then if [ $TODOTXT_AUTO_ARCHIVE = 1 ]; then