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

Function newBugNewCommand

commands/bug/bug_new.go:18–42  ·  view source on GitHub ↗
(env *execenv.Env)

Source from the content-addressed store, hash-verified

16}
17
18func newBugNewCommand(env *execenv.Env) *cobra.Command {
19 options := bugNewOptions{}
20
21 cmd := &cobra.Command{
22 Use: "new",
23 Short: "Create a new bug",
24 PreRunE: execenv.LoadBackendEnsureUser(env),
25 RunE: execenv.CloseBackend(env, func(cmd *cobra.Command, args []string) error {
26 return runBugNew(env, options)
27 }),
28 }
29
30 flags := cmd.Flags()
31 flags.SortFlags = false
32
33 flags.StringVarP(&options.title, "title", "t", "",
34 "Provide a title to describe the issue")
35 flags.StringVarP(&options.message, "message", "m", "",
36 "Provide a message to describe the issue")
37 flags.StringVarP(&options.messageFile, "file", "F", "",
38 "Take the message from the given file. Use - to read the message from the standard input")
39 flags.BoolVar(&options.nonInteractive, "non-interactive", false, "Do not ask for user input")
40
41 return cmd
42}
43
44func runBugNew(env *execenv.Env, opts bugNewOptions) error {
45 var err error

Callers 1

NewBugCommandFunction · 0.85

Calls 3

LoadBackendEnsureUserFunction · 0.92
CloseBackendFunction · 0.92
runBugNewFunction · 0.85

Tested by

no test coverage detected