Skip to content

Commit

Permalink
Minor tweak to the REPL echo
Browse files Browse the repository at this point in the history
  • Loading branch information
xllora committed Jan 6, 2017
1 parent 2b64ca8 commit c61b1af
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tools/vcli/bw/repl/repl.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ func SimpleReadLine(f *os.File) <-chan string {
for scanner.Scan() {
c <- strings.TrimSpace(scanner.Text())
}
cmd := ""
for {
if !scanner.Scan() {
break
}
cmd = strings.TrimSpace(cmd + " " + strings.TrimSpace(scanner.Text()))
if strings.HasSuffix(cmd, ";") {
c <- cmd
cmd = ""
}
}
}()
return c
}
Expand Down Expand Up @@ -100,7 +111,6 @@ func REPL(driver storage.Store, input *os.File, rl ReadLiner, chanSize, bulkSize
for line := range rl(input) {
nl := strings.TrimSpace(line)
if nl == "" {
fmt.Print(prompt)
continue
}
if l != "" {
Expand Down

0 comments on commit c61b1af

Please sign in to comment.