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

Function newBugSelectCommand

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

Source from the content-addressed store, hash-verified

16}
17
18func newBugSelectCommand(env *execenv.Env) *cobra.Command {
19 cmd := &cobra.Command{
20 Use: "select BUG_ID",
21 Short: "Select a bug for implicit use in future commands",
22 Example: `git bug select 2f15
23git bug comment
24git bug status
25`,
26 Long: `Select a bug for implicit use in future commands.
27
28This command allows you to omit any bug ID argument, for example:
29 git bug show
30instead of
31 git bug show 2f153ca
32
33The complementary command is "git bug deselect" performing the opposite operation.
34`,
35 PreRunE: execenv.LoadBackend(env),
36 RunE: execenv.CloseBackend(env, func(cmd *cobra.Command, args []string) error {
37 return runBugSelect(env, args)
38 }),
39 ValidArgsFunction: BugCompletion(env),
40 }
41
42 return cmd
43}
44
45func runBugSelect(env *execenv.Env, args []string) error {
46 if len(args) == 0 {

Callers 1

NewBugCommandFunction · 0.85

Calls 4

LoadBackendFunction · 0.92
CloseBackendFunction · 0.92
runBugSelectFunction · 0.85
BugCompletionFunction · 0.85

Tested by

no test coverage detected