fix confirmation

This commit is contained in:
Shane C 2024-07-25 13:36:42 -04:00
parent cd140e6e1f
commit f2ff008b6a
Signed by: shanec
GPG key ID: E46B5FEA35B22FF9
2 changed files with 6 additions and 16 deletions

13
ansi.go
View file

@ -39,18 +39,7 @@ func Format(codes ...string) string {
var str strings.Builder
for _, code := range codes {
str.WriteString(string(code))
}
return str.String()
}
func Color(colors ...Colors) string {
var str strings.Builder
for _, color := range colors {
str.WriteString(color)
str.WriteString(code)
}
return str.String()

View file

@ -28,8 +28,8 @@ func New(data InputData) (*bool, error) {
fmt.Printf(
tui.Format(tui.FmtBold, tui.FgColorGrey) +
"[" + tui.FgColorGold + "!" + tui.FgColorGrey + "]" + tui.FmtReset + " " +
data.Question +
"(" + tui.FgColorGreen + "y" + tui.FmtReset + "/" + tui.FgColorRed + "n" + tui.FmtReset + "\n " +
data.Question + " " +
"(" + tui.FgColorGreen + "y" + tui.FmtReset + "/" + tui.FgColorRed + "n" + tui.FmtReset + ") " +
tui.FgColorGrey + ">>" + tui.Format(tui.FmtItalic, tui.FgColorGold) + "\n",
)
//fmt.Printf("\033[1m\033[38;5;247m[\033[38;5;214m?\033[38;5;247m]\033[0m %s (\033[38;5;34my\033[0m/\033[38;5;167mn\033[0m) \033[38;5;247m>>\033[3m\033[38;5;214m\n", data.Question)
@ -95,8 +95,9 @@ inputLoop:
if data.Question != "" {
fmt.Printf(
tui.Format(tui.FmtBold, tui.FgColorGrey) +
"[" + tui.FgColorGold + "?" + tui.FgColorGrey + "]" + tui.FmtReset + " " + data.Notice +
"(" + tui.FgColorGreen + "y" + tui.FmtReset + "/" + tui.FgColorRed + "n" + tui.FmtReset + ")" +
"[" + tui.FgColorGold + "!" + tui.FgColorGrey + "]" + tui.FmtReset + " " +
data.Question + " " +
"(" + tui.FgColorGreen + "y" + tui.FmtReset + "/" + tui.FgColorRed + "n" + tui.FmtReset + ") " +
tui.FgColorGrey + ">>" + tui.Format(tui.FmtItalic, tui.FgColorGold) + "\n",
)
//fmt.Printf("\033[1m\033[38;5;247m[\033[38;5;214m?\033[38;5;247m]\033[0m %s (\033[38;5;34my\033[0m/\033[38;5;167mn\033[0m) \033[38;5;247m>>\033[3m\033[38;5;214m\n", data.Question)