feat: add --dry-run flag to action commands

Adds a persistent --dry-run flag that shows matched tasks without
performing mutations. Supported on done, delete, modify, start, and stop
commands. Also fixes preprocessArgs to skip flag-like args when
identifying commands, preventing flags from being treated as filters.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-19 13:47:39 +01:00
parent b02c40f716
commit 6fb8a40a43
6 changed files with 53 additions and 8 deletions
+6
View File
@@ -85,6 +85,12 @@ func modifyTasks(filterArgs, modifierArgs []string) error {
return fmt.Errorf("no tasks matched filter")
}
if dryRunFlag {
fmt.Print(engine.FormatTaskConfirmList("modify", tasks, ws))
fmt.Println("Dry run — no changes made.")
return nil
}
// Confirm if multiple tasks or no filters specified
if len(tasks) > 1 || len(filterArgs) == 0 {
fmt.Print(engine.FormatTaskConfirmList("modify", tasks, ws))