feat: todo done accepts multiple task numbers and prints completed task
All checks were successful
Release / Build and Release (push) Successful in 5s
Continuous Integration / Build Package (push) Successful in 44s
Continuous Integration / Lint, Check & Test (push) Successful in 1m16s

- 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:
Konstantin Fickel 2026-04-24 20:06:32 +02:00
parent 82adb655f1
commit 4d4118f4ce
Signed by: kfickel
GPG key ID: A793722F9933C1A5
3 changed files with 104 additions and 17 deletions

View file

@ -12,7 +12,7 @@ fn main() -> miette::Result<()> {
}) => match action {
None => streamd::cli::commands::todo::run_list(show_future)?,
Some(TodoAction::Edit { number }) => streamd::cli::commands::todo::run_edit(number)?,
Some(TodoAction::Done { number }) => streamd::cli::commands::todo::run_done(number)?,
Some(TodoAction::Done { numbers }) => streamd::cli::commands::todo::run_done(&numbers)?,
},
Some(Commands::Edit { number }) => streamd::cli::commands::edit::run(number)?,
Some(Commands::Timesheet { decimal, debug }) => {