enh: add an 'add' command to the CLI

Bug #255507 reported by Selene ToyKeeper
2
Affects Status Importance Assigned to Milestone
TKDO
Confirmed
Low
Unassigned

Bug Description

A command line function to add new tasks would be useful. Bill Powell has already done most of the UI design in contrib/tkdocli, but there are some tweaks to be made for an integrated version.

The basic usage would be something like one of these:

  t add car Change the oil -d 6m
  t add -f car Change the oil -d 6m
  t add -f ~/text/personal/car/todo.otl Change the oil -d 6m

I'm not yet sure whether the file should be specified by title or path. And, if it's by path, whether the directory should have a default (~/tasks/ or similar).

Also, I'm not sure whether the file needs a '-f' or if the first word should be used for it automatically.

An option is probably needed to specify whether to add new tasks to the top or bottom of the file. Some users may have the bottom reserved for a "Done:" branch with completed tasks. However, adding them at the top tends to put them in reverse order.

Changed in tkdo:
status: New → Confirmed
Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

It would also be nice to have an option to specify a parent task, for things such as:

  t add wri -p "novel" -t "reread chapter 2"

The '-p' or '--parent' option would probably just pick the first task which contained the query string, and add the new task as a child.

It might also be useful to have an option to specify an immediate sibling instead of a parent, but maybe not. It would probably be easier most of the time to just edit the file or use the GUI.

A '--diff' option could help the user verify that the requested change was made correctly.

Changed in tkdo:
milestone: none → 0.7
Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

This is mostly possible in the text UI in TKDO 0.7, though the details are a little different... Instead of:

  t add car Change the oil -i 70 -d 6m
  t add wri -p "novel" -t "reread chapter 2" -t idea

The commands would be:

  t t /car O "Change the oil" /oil i70 :q
  t t /wri /novel o "reread chapter 2" /"chapter 2" ti :q

It doesn't yet allow setting a due date through this method, but the rest works. It just behaves as if the user had typed the given text into the text UI.

Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

Retargeting to 0.8, since 0.7 will have partial support.
(in 0.7, it actually thinks the user is pressing keys in the text UI, so a terminal is required... the regular 'add' command shouldn't need a terminal)

Changed in tkdo:
milestone: 0.7 → 0.8
Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

I haven't really needed this... and it may help to first fix bug 482490, so that the internal API will have the relevant functions to add tasks in the right places. Delaying until 0.9.

Changed in tkdo:
milestone: 0.8 → 0.9
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.