diff --git a/tests/t6030-completion-tasks.sh b/tests/t6030-completion-tasks.sh index 8b344bb..45818db 100755 --- a/tests/t6030-completion-tasks.sh +++ b/tests/t6030-completion-tasks.sh @@ -14,6 +14,7 @@ notice the sunflowers +sunflowers @outside @garden +shared +landscape (C) 2012-02-28 @outside mow the lawn x 2012-02-21 +herbs @oriental buy spices x 2012-02-28 2012-02-21 +slack @home watch tv +2012-02-28 +herbs buy cinnamon @grocer EOF test_todo_completion 'simple task' 'todo.sh list 1' '"1 # simple task"' test_todo_completion 'remove projects and contents from task' 'todo.sh list 2' '"2 # notice the sunflowers"' @@ -21,5 +22,6 @@ test_todo_completion 'keep priority' 'todo.sh list 3' '"3 # (B) smell the flower test_todo_completion 'keep priority and remove timestamp' 'todo.sh list 4' '"4 # (C) mow the lawn"' test_todo_completion 'keep done marker and remove done date' 'todo.sh list 5' '"5 # x buy spices"' test_todo_completion 'keep done marker and remove timestamp and done date' 'todo.sh list 6' '"6 # x watch tv"' +test_todo_completion 'remove add date' 'todo.sh list 7' '"7 # buy cinnamon"' test_done diff --git a/todo_completion b/todo_completion index 3f9d308..31ffc30 100644 --- a/todo_completion +++ b/todo_completion @@ -58,8 +58,8 @@ _todo() # a safety check of the ls action output. local todo=$( \ eval TODOTXT_VERBOSE=0 $_todo_sh '-@ -+ -p -x command ls "^ *${cur} "' | \ - sed -e 's/^ *[0-9]\{1,\} //' -e 's/\((.) \)[0-9]\{2,4\}-[0-9]\{2\}-[0-9]\{2\} /\1/' \ - -e 's/\([xX] \)\([0-9]\{2,4\}-[0-9]\{2\}-[0-9]\{2\} \)\{1,2\}/\1/' \ + sed -e 's/^ *[0-9]\{1,\} //' -e 's/^\((.) \)\{0,1\}[0-9]\{2,4\}-[0-9]\{2\}-[0-9]\{2\} /\1/' \ + -e 's/^\([xX] \)\([0-9]\{2,4\}-[0-9]\{2\}-[0-9]\{2\} \)\{1,2\}/\1/' \ -e 's/[[:space:]]*$//' \ -e '1q' \ )