func confirm(term *liner.State, msg string) bool { confirm, _ := term.Prompt(msg + ", Are you sure? (Y/N) > ") if confirm == "Y" || confirm == "y" { return true } return false }
func promptLoop(quit chan bool, state *liner.State) { for { cmd, err := state.Prompt(" >>> ") state.AppendHistory(cmd) if err != nil { fmt.Println() log.Println("ERROR:", err) quit <- true return } if cmd == "exit" { quit <- true return } } }