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

Function newBugCommentNewCommand

commands/bug/bug_comment_add.go:17–41  ·  view source on GitHub ↗
(env *execenv.Env)

Source from the content-addressed store, hash-verified

15}
16
17func newBugCommentNewCommand(env *execenv.Env) *cobra.Command {
18 options := bugCommentNewOptions{}
19
20 cmd := &cobra.Command{
21 Use: "new [BUG_ID]",
22 Short: "Add a new comment to a bug",
23 PreRunE: execenv.LoadBackendEnsureUser(env),
24 RunE: execenv.CloseBackend(env, func(cmd *cobra.Command, args []string) error {
25 return runBugCommentNew(env, options, args)
26 }),
27 ValidArgsFunction: BugCompletion(env),
28 }
29
30 flags := cmd.Flags()
31 flags.SortFlags = false
32
33 flags.StringVarP(&options.messageFile, "file", "F", "",
34 "Take the message from the given file. Use - to read the message from the standard input")
35
36 flags.StringVarP(&options.message, "message", "m", "",
37 "Provide the new message from the command line")
38 flags.BoolVar(&options.nonInteractive, "non-interactive", false, "Do not ask for user input")
39
40 return cmd
41}
42
43func runBugCommentNew(env *execenv.Env, opts bugCommentNewOptions, args []string) error {
44 b, _, err := ResolveSelected(env.Backend, args)

Callers 1

newBugCommentCommandFunction · 0.85

Calls 4

LoadBackendEnsureUserFunction · 0.92
CloseBackendFunction · 0.92
runBugCommentNewFunction · 0.85
BugCompletionFunction · 0.85

Tested by

no test coverage detected