(env *execenv.Env)
| 16 | } |
| 17 | |
| 18 | func 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 |
| 23 | git bug comment |
| 24 | git bug status |
| 25 | `, |
| 26 | Long: `Select a bug for implicit use in future commands. |
| 27 | |
| 28 | This command allows you to omit any bug ID argument, for example: |
| 29 | git bug show |
| 30 | instead of |
| 31 | git bug show 2f153ca |
| 32 | |
| 33 | The 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 | |
| 45 | func runBugSelect(env *execenv.Env, args []string) error { |
| 46 | if len(args) == 0 { |
no test coverage detected