feat(comment): comment on issues and pull requests the gh way

tea issue comment 12 --body "LGTM" failed with "unknown flag: --body"; the
comment had to be created with issue comment create. issue comment and
pr comment now take the issue or pull request and -b/-F/-e directly,
plus --edit-last and --delete-last for your last comment. The
subcommands stay, create is also add, and a misspelled subcommand
suggests the right one.

Comments are written in the configured editor or a multi-line
"Comment (markdown):" field, which edits start from the current text,
without a confirmation afterwards. The new comment's URL goes to stdout
with a ✓ line; deletes ask "Delete comment 81 on alice/x#1?". comment
list shows each comment under a "#79 alice • about 2 hours ago"
heading on a terminal and as key/value blocks when piped, and comment
JSON gains issue_number.

Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
bircni committed 2026-10-12 00:16:09 +02:00
1 parent 0b6232087e
commit 10417049a1
7 files changed
+514 -143

No files matched your search

+5
View File
@@ -544,6 +544,9 @@ func commandOutputFields(cmd *cobra.Command) []string {
case "comment":
return jsonFields[services.Comment]()
case "issue":
if cmd.Name() == "comment" {
return jsonFields[services.Comment]()
}
return jsonFields[services.Issue]()
case "review":
if cmd.Name() == "request" || cmd.Name() == "cancel-request" {
@@ -563,6 +566,8 @@ func commandOutputFields(cmd *cobra.Command) []string {
return jsonFields[services.Review]()
case "clean":
return jsonFields[git.CleanResult]()
case "comment":
return jsonFields[services.Comment]()
}
return jsonFields[services.Pull]()
case "repo":