diff options
author | Joop Kiefte <ikojba@gmail.com> | 2023-09-29 19:25:42 +0100 |
---|---|---|
committer | Joop Kiefte <ikojba@gmail.com> | 2023-09-29 19:25:42 +0100 |
commit | e2d9b8acde4aa61d4294d945ab02a6a23af68fc5 (patch) | |
tree | 0ce32a9a08d792c4a66b554c53bdb1b7770959a6 | |
parent | 05c5f0361e115d7eff52e56160efd40c6edbc98e (diff) |
Add little trick to quit when no newline
-rw-r--r-- | main.go | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -116,7 +116,11 @@ func Readline() string { // Read a line from stdin reader := bufio.NewReader(os.Stdin) text, _ := reader.ReadString('\n') - return strings.TrimRight(text, "\n") + rtext := strings.TrimRight(text, "\n") + if text == rtext { + return "quit" + } + return rtext } func ExecuteDoltCommand(args ...string) { |