diff --git a/command/pr_create.go b/command/pr_create.go index 608656f4b..5eafdbcbe 100644 --- a/command/pr_create.go +++ b/command/pr_create.go @@ -192,8 +192,18 @@ func prCreate(cmd *cobra.Command, _ []string) error { } } + isDraft, err := cmd.Flags().GetBool("draft") + if err != nil { + return fmt.Errorf("could not parse draft: %w", err) + } + if !isWeb && !autofill { - fmt.Fprintf(colorableErr(cmd), "\nCreating pull request for %s into %s in %s\n\n", + message := "\nCreating pull request for %s into %s in %s\n\n" + if isDraft { + message = "\nCreating draft pull request for %s into %s in %s\n\n" + } + + fmt.Fprintf(colorableErr(cmd), message, utils.Cyan(headBranch), utils.Cyan(baseBranch), ghrepo.FullName(baseRepo)) @@ -245,10 +255,6 @@ func prCreate(cmd *cobra.Command, _ []string) error { return errors.New("pull request title must not be blank") } - isDraft, err := cmd.Flags().GetBool("draft") - if err != nil { - return fmt.Errorf("could not parse draft: %w", err) - } if isDraft && isWeb { return errors.New("the --draft flag is not supported with --web") }