Support --reason flag in daemon mode for reopen command (bd-r46)

The reopen command now properly adds the reason as a comment when
using daemon mode, matching the behavior of direct mode. Uses the
existing RPC AddComment operation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-11-24 01:11:22 -08:00
parent 88009830ee
commit 78847147e1
2 changed files with 83 additions and 76 deletions

View File

@@ -58,9 +58,16 @@ This is more explicit than 'bd update --status open' and emits a Reopened event.
fmt.Fprintf(os.Stderr, "Error reopening %s: %v\n", id, err)
continue
}
// TODO(bd-r46): Add reason as a comment once RPC supports AddComment
// Add reason as a comment if provided
if reason != "" {
fmt.Fprintf(os.Stderr, "Warning: reason not supported in daemon mode yet\n")
commentArgs := &rpc.CommentAddArgs{
ID: id,
Author: actor,
Text: reason,
}
if _, err := daemonClient.AddComment(commentArgs); err != nil {
fmt.Fprintf(os.Stderr, "Warning: failed to add comment to %s: %v\n", id, err)
}
}
if jsonOutput {
var issue types.Issue