From d85a4ee47d13d118aba7efad607ef7b6242f44bc Mon Sep 17 00:00:00 2001 From: rxi Date: Sat, 28 Jun 2014 12:10:53 +0100 Subject: [PATCH] Added option lovebird.echoinput, updated README.md --- README.md | 4 ++++ lovebird.lua | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ec21b9a..fa10bef 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,10 @@ Whether lovebird should wrap the `print()` function or not. If this is true then all the calls to print will also be output to lovebird's console. This is `true` by default. +### lovebird.echoinput +Whether lovebird should display inputted commands in the console's output +buffer; `true` by default. + ### lovebird.maxlines The maximum number of lines lovebird should store in its console's output buffer. By default this is `200`. diff --git a/lovebird.lua b/lovebird.lua index c9f0699..0a6cbfc 100644 --- a/lovebird.lua +++ b/lovebird.lua @@ -21,6 +21,7 @@ lovebird.pages = {} lovebird.wrapprint = true lovebird.timestamp = true lovebird.allowhtml = false +lovebird.echoinput = true lovebird.port = 8000 lovebird.whitelist = { "127.0.0.1", "192.168.*.*" } lovebird.maxlines = 200 @@ -32,7 +33,9 @@ lovebird.pages["index"] = [[ -- Handle console input if req.parsedbody.input then local str = req.parsedbody.input - lovebird.pushline({ type = 'input', str = str }) + if lovebird.echoinput then + lovebird.pushline({ type = 'input', str = str }) + end xpcall(function() assert(lovebird.loadstring(str, "input"))() end, lovebird.onerror) end