From 245db502ccea303ff5832fe7f7a74d2e2d391f58 Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Fri, 8 Feb 2019 19:54:04 +0300 Subject: [PATCH] execute multiple commands with command flag Related #135 --- app.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app.go b/app.go index d2ac00f..7e94a6a 100644 --- a/app.go +++ b/app.go @@ -144,9 +144,13 @@ func (app *app) loop() { if gCommand != "" { p := newParser(strings.NewReader(gCommand)) - if e := p.parseExpr(); e != nil { - log.Printf("evaluating start command: %s", e.String()) - e.eval(app, nil) + + for p.parse() { + p.expr.eval(app, nil) + } + + if p.err != nil { + app.ui.printf("%s", p.err) } }