Changed odd tabs to spaces.

This commit is contained in:
Jared Cordasco
2010-01-05 15:25:31 -05:00
parent 0a7e6337b2
commit d337933fd9

42
todo.sh
View File

@@ -257,12 +257,12 @@ cleaninput()
# Cleanup the input # Cleanup the input
# Replace newlines with spaces Always # Replace newlines with spaces Always
input=`echo $input | tr -d '\r|\n'` input=`echo $input | tr -d '\r|\n'`
# 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 [[ $action =~ '^(append|app|prepend|prep|replace)$' ]]; then if [[ $action =~ '^(append|app|prepend|prep|replace)$' ]]; 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
} }
archive() archive()
@@ -755,15 +755,15 @@ case $action in
"do" ) "do" )
errmsg="usage: $TODO_SH do ITEM#" errmsg="usage: $TODO_SH do ITEM#"
# shift so we get arguments to the do request # shift so we get arguments to the do request
shift; shift;
# 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."
@@ -779,8 +779,8 @@ case $action in
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
archive archive
fi fi
@@ -911,28 +911,28 @@ case $action in
fi fi
cleaninput $input cleaninput $input
# Test for then set priority # Test for then set priority
if [ `sed "$item!d" "$TODO_FILE"|grep -c "^(\\w)"` -eq 1 ]; then if [ `sed "$item!d" "$TODO_FILE"|grep -c "^(\\w)"` -eq 1 ]; then
priority=$(sed "$item!d" "$TODO_FILE" | awk -F '\\(|\\)' '{print $2}') priority=$(sed "$item!d" "$TODO_FILE" | awk -F '\\(|\\)' '{print $2}')
fi fi
# If priority isn't set prepend # If priority isn't set prepend
if [ -z $priority ]; then if [ -z $priority ]; then
if sed -i.bak $item" s|^.*|$input &|" "$TODO_FILE"; then if sed -i.bak $item" s|^.*|$input &|" "$TODO_FILE"; then
newtodo=$(sed "$item!d" "$TODO_FILE") newtodo=$(sed "$item!d" "$TODO_FILE")
[ $TODOTXT_VERBOSE -gt 0 ] && echo "$item: $newtodo" [ $TODOTXT_VERBOSE -gt 0 ] && echo "$item: $newtodo"
else else
echo "TODO: Error prepending task $item." echo "TODO: Error prepending task $item."
fi fi
# If priority is set, remove priority, prepend and add back priority # If priority is set, remove priority, prepend and add back priority
else else
if sed -i.bak -e "$item s/^(.) //" -e "$item s|^.*|\($priority\) $1 &|" "$TODO_FILE"; then if sed -i.bak -e "$item s/^(.) //" -e "$item s|^.*|\($priority\) $1 &|" "$TODO_FILE"; then
newtodo=$(sed "$item!d" "$TODO_FILE") newtodo=$(sed "$item!d" "$TODO_FILE")
[ $TODOTXT_VERBOSE -gt 0 ] && echo "$item: $newtodo" [ $TODOTXT_VERBOSE -gt 0 ] && echo "$item: $newtodo"
else else
echo "TODO: Error prepending task $item." echo "TODO: Error prepending task $item."
fi fi
fi fi
cleanup;; cleanup;;
"pri" | "p" ) "pri" | "p" )