mirror of https://github.com/Hilbis/Hilbish
feat: exit on EOF (^D/ctrl d)
parent
7ac391e3b1
commit
4456d7593b
5
main.go
5
main.go
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue