Changed odd tabs to spaces.

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

36
todo.sh
View File

@@ -262,7 +262,7 @@ cleaninput()
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,12 +755,12 @@ 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"
@@ -779,7 +779,7 @@ 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
@@ -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" )