MCPcopy
hub / github.com/cli/cli / runEdit

Function runEdit

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

Source from the content-addressed store, hash-verified

186}
187
188func runEdit(opts *CommentOptions, c client.DiscussionClient, baseRepo ghrepo.Interface) error {
189 commentID, err := resolveCommentID(opts, c, baseRepo)
190 if err != nil {
191 return err
192 }
193
194 existing, err := c.GetComment(baseRepo.RepoHost(), commentID)
195 if err != nil {
196 return err
197 }
198
199 body, err := resolveBody(opts, existing.Body)
200 if err != nil {
201 return err
202 }
203
204 opts.IO.StartProgressIndicator()
205 comment, err := c.UpdateComment(baseRepo, commentID, body)
206 opts.IO.StopProgressIndicator()
207 if err != nil {
208 return err
209 }
210
211 fmt.Fprintln(opts.IO.Out, comment.URL)
212 return nil
213}
214
215func runReply(opts *CommentOptions, c client.DiscussionClient, baseRepo ghrepo.Interface) error {
216 commentID, err := resolveCommentID(opts, c, baseRepo)

Callers 1

commentRunFunction · 0.70

Calls 7

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

Tested by

no test coverage detected