MCPcopy Index your code
hub / github.com/git-bug/git-bug / newBugCommentEditCommand

Function newBugCommentEditCommand

commands/bug/bug_comment_edit.go:16–40  ·  view source on GitHub ↗
(env *execenv.Env)

Source from the content-addressed store, hash-verified

14}
15
16func newBugCommentEditCommand(env *execenv.Env) *cobra.Command {
17 options := bugCommentEditOptions{}
18
19 cmd := &cobra.Command{
20 Use: "edit [COMMENT_ID]",
21 Short: "Edit an existing comment on a bug",
22 Args: cobra.ExactArgs(1),
23 PreRunE: execenv.LoadBackendEnsureUser(env),
24 RunE: execenv.CloseBackend(env, func(cmd *cobra.Command, args []string) error {
25 return runBugCommentEdit(env, options, args)
26 }),
27 }
28
29 flags := cmd.Flags()
30 flags.SortFlags = false
31
32 flags.StringVarP(&options.messageFile, "file", "F", "",
33 "Take the message from the given file. Use - to read the message from the standard input")
34
35 flags.StringVarP(&options.message, "message", "m", "",
36 "Provide the new message from the command line")
37 flags.BoolVar(&options.nonInteractive, "non-interactive", false, "Do not ask for user input")
38
39 return cmd
40}
41
42func runBugCommentEdit(env *execenv.Env, opts bugCommentEditOptions, args []string) error {
43 b, commentId, err := env.Backend.Bugs().ResolveComment(args[0])

Callers 1

newBugCommentCommandFunction · 0.85

Calls 3

LoadBackendEnsureUserFunction · 0.92
CloseBackendFunction · 0.92
runBugCommentEditFunction · 0.85

Tested by

no test coverage detected