MCPcopy
hub / github.com/cli/cli / runReply

Function runReply

pkg/cmd/discussion/comment/comment.go:215–242  ·  view source on GitHub ↗
(opts *CommentOptions, c client.DiscussionClient, baseRepo ghrepo.Interface)

Source from the content-addressed store, hash-verified

213}
214
215func runReply(opts *CommentOptions, c client.DiscussionClient, baseRepo ghrepo.Interface) error {
216 commentID, err := resolveCommentID(opts, c, baseRepo)
217 if err != nil {
218 return err
219 }
220
221 opts.IO.StartProgressIndicator()
222 existing, err := c.GetComment(baseRepo.RepoHost(), commentID)
223 opts.IO.StopProgressIndicator()
224 if err != nil {
225 return err
226 }
227
228 body, err := resolveBody(opts, "")
229 if err != nil {
230 return err
231 }
232
233 opts.IO.StartProgressIndicator()
234 comment, err := c.AddComment(baseRepo, existing.DiscussionID, body, commentID)
235 opts.IO.StopProgressIndicator()
236 if err != nil {
237 return err
238 }
239
240 fmt.Fprintln(opts.IO.Out, comment.URL)
241 return nil
242}
243
244func runAdd(opts *CommentOptions, c client.DiscussionClient, baseRepo ghrepo.Interface) error {
245 body, err := resolveBody(opts, "")

Callers 1

commentRunFunction · 0.85

Calls 7

resolveCommentIDFunction · 0.85
resolveBodyFunction · 0.85
GetCommentMethod · 0.65
RepoHostMethod · 0.65
StopProgressIndicatorMethod · 0.65
AddCommentMethod · 0.65

Tested by

no test coverage detected