From 263c9d9fefdbeec76244308c9c69082e2880afa0 Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Sun, 10 Sep 2017 17:14:50 +0300 Subject: [PATCH] enable user defined 'put' commands Mentioned in #48. --- eval.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eval.go b/eval.go index 428db61..8f36971 100644 --- a/eval.go +++ b/eval.go @@ -365,7 +365,9 @@ func (e *callExpr) eval(app *app, args []string) { log.Printf(msg) } case "put": - if err := app.nav.put(); err != nil { + if cmd, ok := gOpts.cmds["put"]; ok { + cmd.eval(app, e.args) + } else if err := app.nav.put(); err != nil { msg := fmt.Sprintf("put: %s", err) app.ui.message = msg log.Printf(msg)