mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 19:11:25 +01:00
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:
7 files changed
+514
-143
No files matched your search
@@ -23,6 +23,10 @@ func TestCommentEditorDraftLifecycle(t *testing.T) {
|
||||
t.Run(mode, func(t *testing.T) {
|
||||
requests := 0
|
||||
server := newAuthenticatedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if r.Method == http.MethodGet {
|
||||
_, _ = w.Write([]byte(`{"number":3,"title":"Crash"}`))
|
||||
return
|
||||
}
|
||||
requests++
|
||||
var options struct{ Body string }
|
||||
require.NoError(t, json.NewDecoder(r.Body).Decode(&options))
|
||||
|
||||
Reference in new issue
Block a user