31 lines
455 B
Go
31 lines
455 B
Go
package utils
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
)
|
|
|
|
func PromptContinue() bool {
|
|
ret := strings.ToLower(prompt("Continue (y/n)"))
|
|
if ret == "y" || ret == "yes" {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
func PromptMenu(listMenu func()) int {
|
|
listMenu()
|
|
|
|
var option int
|
|
fmt.Scanf("%d", &option)
|
|
return option
|
|
}
|
|
|
|
func prompt(question string) string {
|
|
fmt.Printf("%s %s :%s", colorYellow, question, colorReset)
|
|
var ret string
|
|
fmt.Scanf("%s", &ret)
|
|
return ret
|
|
}
|