Skip to content

Commit 8b6d664

Browse files
committed
Update input prompts with colored text, modify force flag description
1 parent d5489b8 commit 8b6d664

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

cmd/pr.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Requires Git to be installed on the system. If a title is not provided, one will
6464

6565
log.Debugf("Got %d logs", len(strings.Split(logs, "\n")))
6666

67-
fmt.Print("Title: ")
67+
utils.PrintColoredText("Title: ", c.OttoColor)
6868
if title == "" {
6969
// generate the title
7070
log.Debug("Generating title...")
@@ -78,6 +78,8 @@ Requires Git to be installed on the system. If a title is not provided, one will
7878
log.Errorf("Error printing chat completion stream: %s", err)
7979
os.Exit(1)
8080
}
81+
} else {
82+
fmt.Println(title)
8183
}
8284

8385
log.Debugf("Title: %s", title)
@@ -149,7 +151,7 @@ Requires Git to be installed on the system. If a title is not provided, one will
149151
prompt = "Title: " + title + "\n\nGit logs: " + logs + "\n\nGit diff: " + diff
150152
}
151153

152-
fmt.Print("Body: ")
154+
utils.PrintColoredText("Body: ", c.OttoColor)
153155
stream, err := ai.PRBody(prompt, c)
154156
if err != nil {
155157
log.Errorf("Error generating PR body: %s", err)
@@ -162,7 +164,8 @@ Requires Git to be installed on the system. If a title is not provided, one will
162164
os.Exit(1)
163165
}
164166

165-
fmt.Println("Branch: ", base)
167+
utils.PrintColoredText("Branch: ", c.OttoColor)
168+
fmt.Println(base)
166169

167170
if !push {
168171
os.Exit(0)

cmd/release.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,22 @@ It will create a new release given a tag and post it to GitHub as a draft.`,
3838
}
3939

4040
if previousTag == "" {
41-
previousTag, err = utils.Input("Previous tag: ")
41+
previousTag, err = utils.InputWithColor("Previous tag: ", c.UserColor)
4242
if err != nil {
4343
log.Errorf("Error getting previous tag: %s", err)
4444
os.Exit(1)
4545
}
4646
}
4747

4848
if currentTag == "" {
49-
currentTag, err = utils.Input("Current tag: ")
49+
currentTag, err = utils.InputWithColor("Current tag: ", c.UserColor)
5050
if err != nil {
5151
log.Errorf("Error getting current tag: %s", err)
5252
os.Exit(1)
5353
}
5454
}
5555

56-
fmt.Print("Release notes: ")
56+
utils.PrintColoredText("Release notes: ", c.OttoColor)
5757

5858
// get the log between the tags
5959
gitLog, err := git.LogBetween(previousTag, currentTag)
@@ -114,7 +114,7 @@ func init() {
114114
RootCmd.AddCommand(releaseCmd)
115115

116116
releaseCmd.Flags().BoolVarP(&verbose, "verbose", "v", false, "Verbose output")
117-
releaseCmd.Flags().BoolVarP(&force, "force", "f", false, "Force overwrite of existing file")
117+
releaseCmd.Flags().BoolVarP(&force, "force", "f", false, "Do not prompt for confirmation")
118118
releaseCmd.Flags().StringVarP(&previousTag, "prev-tag", "p", "", "Previous tag")
119119
releaseCmd.Flags().StringVarP(&currentTag, "tag", "t", "", "Current tag")
120120
}

0 commit comments

Comments
 (0)