Disable interactivity if any flag is passed
- Error if title is an empty string
This commit is contained in:
parent
4b32e3f215
commit
76c73db5a0
1 changed files with 5 additions and 1 deletions
|
|
@ -383,7 +383,7 @@ func issueCreate(cmd *cobra.Command, args []string) error {
|
|||
|
||||
action := SubmitAction
|
||||
|
||||
interactive := !cmd.Flags().Changed("title") || !cmd.Flags().Changed("body")
|
||||
interactive := !cmd.Flags().Changed("title") && !cmd.Flags().Changed("body")
|
||||
|
||||
if interactive {
|
||||
tb, err := titleBodySurvey(cmd, title, body, defaults{}, templateFiles)
|
||||
|
|
@ -405,6 +405,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