skeleton for testing purposes

This commit is contained in:
lin committed 2026-10-05 14:17:03 +02:00
1 parent 8076b30e3f
commit 71e4f1294e
11 files changed
+273

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
package cli
import (
"bufio"
"fmt"
"log"
"os"
"strings"
)
func Listen() {
reader := bufio.NewScanner(os.Stdin)
fmt.Print("> ")
for {
if !reader.Scan() {
log.Println("Program terminated (SIGINT)")
return
}
if err := reader.Err(); err != nil {
log.Printf("Console input error: %v\n", err)
return
}
text := strings.TrimSpace(reader.Text())
switch text {
case "exit":
return
}
}
}