(opts *CommentOptions, c client.DiscussionClient, baseRepo ghrepo.Interface)
| 163 | } |
| 164 | |
| 165 | func runDelete(opts *CommentOptions, c client.DiscussionClient, baseRepo ghrepo.Interface) error { |
| 166 | commentID, err := resolveCommentID(opts, c, baseRepo) |
| 167 | if err != nil { |
| 168 | return err |
| 169 | } |
| 170 | |
| 171 | if _, err := c.GetComment(baseRepo.RepoHost(), commentID); err != nil { |
| 172 | return err |
| 173 | } |
| 174 | |
| 175 | if !opts.Yes { |
| 176 | confirmed, err := opts.Prompter.Confirm("Are you sure you want to delete this comment?", false) |
| 177 | if err != nil { |
| 178 | return err |
| 179 | } |
| 180 | if !confirmed { |
| 181 | return cmdutil.CancelError |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | return c.DeleteComment(baseRepo, commentID) |
| 186 | } |
| 187 | |
| 188 | func runEdit(opts *CommentOptions, c client.DiscussionClient, baseRepo ghrepo.Interface) error { |
| 189 | commentID, err := resolveCommentID(opts, c, baseRepo) |
no test coverage detected