Merge pull request #819 from rista404/interactive-when-defaults-807

Disable interactive mode for `issue create` if all flags are passed
This commit is contained in:
Mislav Marohnić 2020-05-07 16:29:04 +02:00 committed by GitHub
commit 5913a72532
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -398,7 +398,7 @@ func issueCreate(cmd *cobra.Command, args []string) error {
action := SubmitAction
interactive := title == "" || body == ""
interactive := !(cmd.Flags().Changed("title") && cmd.Flags().Changed("body"))
if interactive {
tb, err := titleBodySurvey(cmd, title, body, defaults{}, templateFiles)
@ -420,6 +420,10 @@ func issueCreate(cmd *cobra.Command, args []string) error {
if body == "" {
body = tb.Body
}
} else {
if title == "" {
return fmt.Errorf("title can't be blank")
}
}
if action == PreviewAction {