Skip to content

Commit

Permalink
Comment update and update exit message to the REPL
Browse files Browse the repository at this point in the history
  • Loading branch information
xllora committed Jul 8, 2017
1 parent f6292b4 commit 76d3cfe
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tools/vcli/bw/repl/repl.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ func New(driver storage.Store, chanSize, bulkSize, builderSize int, rl ReadLiner
type ReadLiner func(done chan bool) <-chan string

// SimpleReadLine reads a line from the provided file. This does not support
// any advanced terminal functionalities.
// any advanced terminal capabilities.
//
// TODO(xllora): Replace simple reader for function that supports advanced
// terminal input.
// This function can be replaced with more advanced functionality, as shown
// https://github.com/xllora/bwdrivers/blob/master/bw/main.go.
func SimpleReadLine(done chan bool) <-chan string {
c := make(chan string)
go func() {
Expand Down Expand Up @@ -89,7 +89,7 @@ func SimpleReadLine(done chan bool) <-chan string {
// REPL starts a read-evaluation-print-loop to run BQL commands.
func REPL(driver storage.Store, input *os.File, rl ReadLiner, chanSize, bulkSize, builderSize int, done chan bool) int {
var tracer io.Writer
ctx, isTracingToFile := context.Background(), false
ctx, isTracingToFile, sessionStart := context.Background(), false, time.Now()

stopTracing := func() {
if tracer != nil {
Expand All @@ -104,9 +104,9 @@ func REPL(driver storage.Store, input *os.File, rl ReadLiner, chanSize, bulkSize

fmt.Printf("Welcome to BadWolf vCli (%d.%d.%d-%s)\n", version.Major, version.Minor, version.Patch, version.Release)
fmt.Printf("Using driver %q. Type quit; to exit\n", driver.Name(ctx))
fmt.Printf("Session started at %v\n\n", time.Now())
fmt.Printf("Session started at %v\n\n", sessionStart)
defer func() {
fmt.Printf("\n\nThanks for all those BQL queries!\n\n")
fmt.Printf("\n\nThanks for all those BQL queries!\nSession duration: %v\n\n", time.Now().Sub(sessionStart) )
}()

for l := range rl(done) {
Expand Down

0 comments on commit 76d3cfe

Please sign in to comment.