You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

con.go 508B

123456789101112131415161718192021222324252627282930
  1. package chocococon
  2. import (
  3. "bufio"
  4. "fmt"
  5. "os"
  6. "git.timschuster.info/stephan.graf/Complete_hardware_Control"
  7. )
  8. var curCHC HardwareControl.HardwareControlInterface
  9. func Run() {
  10. bufin := bufio.NewReader(os.Stdin)
  11. for {
  12. line, err := readCmdLine(bufin)
  13. if err != nil {
  14. fmt.Println("Error: ", err)
  15. return
  16. }
  17. err = exec(makeTokens(line))
  18. if err == errExit {
  19. fmt.Println(err.Error())
  20. return
  21. } else if err != nil {
  22. fmt.Println(err.Error())
  23. continue
  24. }
  25. fmt.Println("OK")
  26. }
  27. }