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 } } }
func UpdateHistory(liner *liner.State, dir, line string) (int, string) { liner.AppendHistory(line) if dir != "" { err_code, err_str := WriteHistoryToFile(liner, dir+"/.cbq_history") if err_code != 0 { return err_code, err_str } } return 0, "" }
func UpdateHistory(liner *liner.State, currentUser *user.User, line string) { liner.AppendHistory(line) if currentUser != nil && currentUser.HomeDir != "" { WriteHistoryToFile(liner, currentUser.HomeDir+"/.tuq_history") } }
func UpdateHistory(liner *liner.State, dir, line string) { liner.AppendHistory(line) if dir != "" { WriteHistoryToFile(liner, dir+"/.cbq_history") } }