feat: todo done accepts multiple task numbers and prints completed task
- Change `todo done <N>` to variadic `todo done <N>...` for stable indices across sequential calls - Process multiple numbers highest-index-first so lower indices remain valid as tasks are removed - Validate all numbers upfront before mutating any files - After marking done, print the full task block (same format as list) so the user gets visual confirmation of what was completed - Extract `mark_task_done` as a testable helper; add unit tests
This commit is contained in:
parent
82adb655f1
commit
4d4118f4ce
3 changed files with 104 additions and 17 deletions
|
|
@ -20,10 +20,11 @@ pub enum TodoAction {
|
|||
/// Task number to edit
|
||||
number: usize,
|
||||
},
|
||||
/// Mark a task as done
|
||||
/// Mark one or more tasks as done
|
||||
Done {
|
||||
/// Task number to mark as done
|
||||
number: usize,
|
||||
/// Task numbers to mark as done (processed highest-index-first for stable indices)
|
||||
#[arg(required = true, num_args = 1..)]
|
||||
numbers: Vec<usize>,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue