Added sed line to allow priorities to be added on the command line with auto add date enabled.

Inserted test for this case in the t1010-add-date.sh test case.
This commit is contained in:
Tom Scogland
2011-03-09 12:00:15 -05:00
committed by Gina Trapani
parent e24777fa2c
commit 7900ad7e1b
2 changed files with 17 additions and 1 deletions

View File

@@ -21,6 +21,22 @@ TODO: 1 added.
TODO: 1 of 1 tasks shown
EOF
test_todo_session 'cmd line first day with priority' <<EOF
>>> todo.sh -pt add '(A) notice the daisies'
2 (A) 2009-02-13 notice the daisies
TODO: 2 added.
>>> todo.sh -p list
2 (A) 2009-02-13 notice the daisies
1 2009-02-13 notice the daisies
--
TODO: 2 of 2 tasks shown
>>> todo.sh -npf del 2
2 (A) 2009-02-13 notice the daisies
TODO: 2 deleted.
EOF
test_tick
test_todo_session 'cmd line second day' <<EOF

View File

@@ -619,7 +619,7 @@ _addto() {
if [[ $TODOTXT_DATE_ON_ADD = 1 ]]; then
now=$(date '+%Y-%m-%d')
input="$now $input"
input=`echo "$input" | sed -e 's/^\(([A-Z]) \)\{0,1\}/\1'"$now /"`
fi
echo "$input" >> "$file"
if [ $TODOTXT_VERBOSE -gt 0 ]; then