VladimirMarkelov/ttdl

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

obbardc opened this issue · 4 comments

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.

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

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.

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

  • in two calls: ttdl add "todo text" and then ttdl edit 1 --set-due 1w
  • in one call: ttdl add "todo text due:1w"

0.9.0 includes the feature