aboutsummaryrefslogtreecommitdiffstats
path: root/commands/title_edit.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/title_edit.go')
-rw-r--r--commands/title_edit.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/commands/title_edit.go b/commands/title_edit.go
index 455c9384..09415e49 100644
--- a/commands/title_edit.go
+++ b/commands/title_edit.go
@@ -9,7 +9,8 @@ import (
)
type titleEditOptions struct {
- title string
+ title string
+ nonInteractive bool
}
func newTitleEditCommand() *cobra.Command {
@@ -32,6 +33,7 @@ func newTitleEditCommand() *cobra.Command {
flags.StringVarP(&options.title, "title", "t", "",
"Provide a title to describe the issue",
)
+ flags.BoolVar(&options.nonInteractive, "non-interactive", false, "Do not ask for user input")
return cmd
}
@@ -45,6 +47,10 @@ func runTitleEdit(env *Env, opts titleEditOptions, args []string) error {
snap := b.Snapshot()
if opts.title == "" {
+ if opts.nonInteractive {
+ env.err.Println("No title given. Use -m or -F option to specify a title. Aborting.")
+ return nil
+ }
opts.title, err = input.BugTitleEditorInput(env.repo, snap.Title)
if err == input.ErrEmptyTitle {
env.out.Println("Empty title, aborting.")