| 140 | } |
| 141 | |
| 142 | func 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 | |
| 165 | func runDelete(opts *CommentOptions, c client.DiscussionClient, baseRepo ghrepo.Interface) error { |
| 166 | commentID, err := resolveCommentID(opts, c, baseRepo) |