VladimirMarkelov / ttdl

TTDL - Terminal Todo List Manager
MIT License
210 stars 17 forks source link

Completing issue with `rec:` does not mark the old task as complete #53

Closed SevereOverfl0w closed 2 years ago

SevereOverfl0w commented 2 years ago

In the following, I would expect the final command to output differently.

/tmp
❯ ttdl --local list  
# D P Created    Finished   Due        Subject
-----------------------------------------------
-----------------------------------------------
0 todos

/tmp
❯ ttdl --local add 'Task due:today rec:1w'
Added todo:
# D P Created    Finished   Due        Subject
-----------------------------------------------
1 R   2021-10-10            2021-10-10 Task due:2021-10-10 rec:1w

/tmp
❯ ttdl --local done 1                     
Changed todos:
# D P Created    Finished   Due        Subject
-----------------------------------------------
1 R   2021-10-10            2021-10-17 Task due:2021-10-17 rec:1w
-----------------------------------------------
1 todos

/tmp
❯ cat todo.txt                
2021-10-10 Task due:2021-10-17 rec:1w

Instead, I would expect todo.txt to contain:

2021-10-10 Task due:2021-10-17 rec:1w
x 2021-10-10 2021-10-10 Task due:2021-10-10 rec:1w
VladimirMarkelov commented 2 years ago

It is the behavior I copied from a library I used before(either for code simplicity or for another reason it did the same): marking a todo done never created a new task, it always modified existing one. Later I discovered that some todo apps create a new todo and mark old one done. But I kept the old way as I was fine with it and nobody asked for a change. On the other hand, marking "done" and creating a new todo let a person to track the number of done tasks more correctly.

As I see, this task needs the same code changes as #52. I'll do it.

VladimirMarkelov commented 2 years ago

Implemented in just published 3.1.0