VladimirMarkelov / ttdl

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

feature request: allow --set-due argument for new tasks #29

Closed obbardc closed 4 years ago

obbardc commented 4 years ago

currently to create a task with a due date, two calls are required:

$ ttdl new snakes
Added todo:
# D P Created    Finished   Due        Threshold  Spent  Subject
-----------------------------------------------------------------
4                                                        snakes
$ ttdl edit 4 --set-due=2020-07-03
Changed todos:
# D P Created    Finished   Due        Threshold  Spent  Subject
-----------------------------------------------------------------
4                           2020-07-03                   snakes
-----------------------------------------------------------------
1 todos (of 4 total)

it'd be much nicer to reduce this to one call, like: ttdl new snakes --set-due=2020-07-03 incorporating #28 into this would make this really slick.

thomasjfox commented 4 years ago

You can specify a due date while adding new tasks like this: ttdl new "rustysnake due:2020-07-03"

Output:

$ todo new "rustysnake due:2020-07-03"
Added todo:
 # D P Created    Finished   Due        Threshold  Spent  Subject
------------------------------------------------------------------
99     2020-07-02            2020-07-03                   rustysnake

of course having the feature from #28 would be nice to give due:2d

VladimirMarkelov commented 4 years ago

Yes, it can be done with ttdl new "rustysnake due:2020-07-03" but all the parsing is done by the library that do not support "human-readable" dates(except in task recurrence interval). Anyway, I can support both ways: look for due: in the string and convert human-readable to real date before passing to the library, and --set-due for explicit setting due date.

VladimirMarkelov commented 4 years ago

Everything described in #28 is applied to todo's text. You can add a todo with a human-date in two ways:

VladimirMarkelov commented 4 years ago

0.9.0 includes the feature