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.
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