()
| 17 | } |
| 18 | |
| 19 | func newReplyCommand() *replyCommand { |
| 20 | replyCommand := &replyCommand{} |
| 21 | replyCommand.cmd = &cobra.Command{ |
| 22 | Use: "reply <thread-id>", |
| 23 | Short: "Reply to a thread", |
| 24 | Annotations: map[string]string{ |
| 25 | "agent_notes": "Replies to the latest entry in a thread. Accepts message via -m, stdin, or $EDITOR.", |
| 26 | }, |
| 27 | Example: ` hey reply 12345 -m "Thanks!" |
| 28 | echo "Detailed reply" | hey reply 12345`, |
| 29 | RunE: replyCommand.run, |
| 30 | Args: usageExactOneArg(), |
| 31 | } |
| 32 | |
| 33 | replyCommand.cmd.Flags().StringVarP(&replyCommand.message, "message", "m", "", "Reply message (or opens $EDITOR)") |
| 34 | |
| 35 | return replyCommand |
| 36 | } |
| 37 | |
| 38 | func (c *replyCommand) run(cmd *cobra.Command, args []string) error { |
| 39 | if err := requireAuth(); err != nil { |
no test coverage detected