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:
commit
5913a72532
1 changed files with 5 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue