MCPcopy
hub / github.com/cli/cli / commentRun

Function commentRun

pkg/cmd/discussion/comment/comment.go:142–163  ·  view source on GitHub ↗
(opts *CommentOptions)

Source from the content-addressed store, hash-verified

140}
141
142func commentRun(opts *CommentOptions) error {
143 baseRepo, err := opts.BaseRepo()
144 if err != nil {
145 return err
146 }
147
148 c, err := opts.Client()
149 if err != nil {
150 return err
151 }
152
153 if opts.Delete {
154 return runDelete(opts, c, baseRepo)
155 }
156 if opts.Edit {
157 return runEdit(opts, c, baseRepo)
158 }
159 if opts.ParsedArg.CommentNodeID != "" || opts.ParsedArg.CommentDatabaseID != 0 {
160 return runReply(opts, c, baseRepo)
161 }
162 return runAdd(opts, c, baseRepo)
163}
164
165func runDelete(opts *CommentOptions, c client.DiscussionClient, baseRepo ghrepo.Interface) error {
166 commentID, err := resolveCommentID(opts, c, baseRepo)

Callers 2

NewCmdCommentFunction · 0.85
TestCommentRunFunction · 0.85

Calls 5

runReplyFunction · 0.85
runDeleteFunction · 0.70
runEditFunction · 0.70
runAddFunction · 0.70
BaseRepoMethod · 0.65

Tested by 1

TestCommentRunFunction · 0.68