(env *execenv.Env)
| 14 | } |
| 15 | |
| 16 | func newBugTitleEditCommand(env *execenv.Env) *cobra.Command { |
| 17 | options := bugTitleEditOptions{} |
| 18 | |
| 19 | cmd := &cobra.Command{ |
| 20 | Use: "edit [BUG_ID]", |
| 21 | Short: "Edit a title of a bug", |
| 22 | PreRunE: execenv.LoadBackendEnsureUser(env), |
| 23 | RunE: execenv.CloseBackend(env, func(cmd *cobra.Command, args []string) error { |
| 24 | return runBugTitleEdit(env, options, args) |
| 25 | }), |
| 26 | ValidArgsFunction: BugCompletion(env), |
| 27 | } |
| 28 | |
| 29 | flags := cmd.Flags() |
| 30 | flags.SortFlags = false |
| 31 | |
| 32 | flags.StringVarP(&options.title, "title", "t", "", |
| 33 | "Provide a title to describe the issue", |
| 34 | ) |
| 35 | flags.BoolVar(&options.nonInteractive, "non-interactive", false, "Do not ask for user input") |
| 36 | |
| 37 | return cmd |
| 38 | } |
| 39 | |
| 40 | func runBugTitleEdit(env *execenv.Env, opts bugTitleEditOptions, args []string) error { |
| 41 | b, _, err := ResolveSelected(env.Backend, args) |
no test coverage detected