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
@@ -47,6 +47,12 @@ func startTasks(args []string) error {
return fmt.Errorf("no tasks matched filter")
}
if dryRunFlag {
fmt.Print(engine.FormatTaskConfirmList("start", tasks, ws))
fmt.Println("Dry run — no changes made.")
return nil
}
for _, task := range tasks {
task.StartTask()
fmt.Printf("Started task: %s\n", task.Description)