handle Ctrl-D

This commit is contained in:
Leihb 2018-06-01 19:06:59 +08:00
parent 96db984e09
commit 33b354d83d

View File

@ -375,6 +375,8 @@ func main() {
} }
} else if err == liner.ErrPromptAborted { } else if err == liner.ErrPromptAborted {
return return
} else if err == io.EOF {
os.Exit(0)
} else { } else {
fmt.Fprintf(os.Stderr, "Error reading line: %s", err.Error()) fmt.Fprintf(os.Stderr, "Error reading line: %s", err.Error())
} }