--- - 2006-07-20 22:57:36.000000000 +0200 +++ /dev/fd/63 2006-07-20 22:57:36.000000000 +0200 @@ -414,6 +414,47 @@ [[ $VERBOSE = 1 ]] && echo "TODO: Report file updated." cat "$REPORT_FILE" cleanup;; + +"tickle" ) + + item=$2; + [ -z "$item" ] && die "$errmsg" + [[ "$item" = +([0-9]) ]] || die "$errmsg" + + datetype=$3; + + if [ -z "$datetype" ]; then + echo "Tickle to day or month folder? (d/m)" + read ANSWER + if [ "$ANSWER" = "d" ]; then + FOLDER="days" + echo "Tickle to which day folder?" + read NUMBER + elif [ "$ANSWER" = "m" ]; then + FOLDER="months" + echo "Tickle to which month folder?" + read NUMBER + fi + else + if expr "$datetype" : ' *[dD].*' > /dev/null; then + FOLDER="days" + NUMBER="`echo $datetype | sed 's/d//'`" + elif expr "$datetype" : ' *[mM].*' > /dev/null; then + FOLDER="months" + NUMBER="`echo $datetype | sed 's/m//'`" + fi + fi + LENGTH=`expr "$NUMBER" : ".*"` + if [ "$LENGTH" = "1" ]; then + NUMBER="0$NUMBER" + fi + if sed -ne "$item p" "$TODO_FILE" | grep "^."; then + DELETEME=$(sed "$item!d" "$TODO_FILE") + fi + echo $DELETEME >> $TICKLER_DIR/$TYPE/$FOLDER/$NUMBER/$NUMBER.txt + sed -i.bak -e $2"s/^.*//" -e '/./!d' "$TODO_FILE" + echo "Moved todo $2 to $TICKLER_DIR/$TYPE/$FOLDER/$NUMBER/$NUMBER.txt" + cleanup;; * ) usage esac