add option to execute command on server initialization (#135)

This commit is contained in:
Daniel Lewan authored and gokcehan committed 2019-02-06 14:56:06 +03:00
1 parent 79b05dc365
commit 0fc14e3b2d
2 files changed
+14

No files matched your search

+8
View File
@@ -136,6 +136,14 @@ func (app *app) loop() {
clientChan := app.ui.readExpr()
serverChan := readExpr()
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 {
select {
case <-app.quitChan: