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:
@@ -47,6 +47,12 @@ func stopTasks(args []string) error {
|
||||
return fmt.Errorf("no tasks matched filter")
|
||||
}
|
||||
|
||||
if dryRunFlag {
|
||||
fmt.Print(engine.FormatTaskConfirmList("stop", tasks, ws))
|
||||
fmt.Println("Dry run — no changes made.")
|
||||
return nil
|
||||
}
|
||||
|
||||
for _, task := range tasks {
|
||||
task.StopTask()
|
||||
fmt.Printf("Stopped task: %s\n", task.Description)
|
||||
|
||||
Reference in New Issue
Block a user