mobyvb / tasklist

a tool to keep track of tasks and how long you've been working on them
0 stars 0 forks source link

Support subtasks #21

Open black-crowned-night-heron opened 1 year ago

black-crowned-night-heron commented 1 year ago

For the "add-subtask" functionality, we added another command and created an "addSubtask" function to handle it. A task now includes a slice of subtasks. These subtasks are printed indented under the main task in the tasklist using the "prefix" parameter added to the printTask and printTaskList functions. When calculating the total time spent on a task, we now also iterate over the subtasks and add their work time to the total. The workOnTask function has been modified to handle a subtask index. If it sees a '.' character in the index, it splits it into two parts and uses them to access the task and subtask. Finally, subtasks are added to the JSON representation of a task, allowing them to be saved and loaded with the main task list.

Resolves #20