2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-04-01 11:13:24 +00:00

feat: exit on EOF (^D/ctrl d)

This commit is contained in:
TorchedSammy 2021-03-20 12:57:18 -04:00
parent 7ac391e3b1
commit 4456d7593b

View File

@ -9,6 +9,7 @@ import (
"syscall"
"os/signal"
"strings"
"io"
"github.com/akamensky/argparse"
"github.com/bobappleyard/readline"
@ -51,6 +52,10 @@ func main() {
//fmt.Printf(prompt)
cmdString, err := readline.String(prompt)
if err == io.EOF {
fmt.Println("")
break
}
if err != nil {
fmt.Fprintln(os.Stderr, err)
}