From 177ba91d516b8e4778da58a87f02f9eb490848cd Mon Sep 17 00:00:00 2001 From: Josh Deprez Date: Thu, 26 Aug 2021 10:06:51 +1000 Subject: [PATCH] add comment --- engine/repl.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/engine/repl.go b/engine/repl.go index d36025d..4de8892 100644 --- a/engine/repl.go +++ b/engine/repl.go @@ -9,7 +9,10 @@ import ( "strings" ) +// REPL runs a read-evaluate-print-loop. Commands are taken from src and output +// is written to dst. assets is needed for commands like reload. func (g *Game) REPL(src io.Reader, dst io.Writer, assets fs.FS) error { + fmt.Fprint(dst, "game>") sc := bufio.NewScanner(src) for sc.Scan() { tok := strings.Split(sc.Text(), " ") @@ -53,7 +56,6 @@ func (g *Game) REPL(src io.Reader, dst io.Writer, assets fs.FS) error { g.Enable() g.Show() case "tree": - var c interface{} = g if len(tok) == 2 { // subtree @@ -93,6 +95,7 @@ func (g *Game) REPL(src io.Reader, dst io.Writer, assets fs.FS) error { } } } + fmt.Fprint(dst, "game>") } return sc.Err() }