mirror of
https://github.com/rxi/lovebird.git
synced 2024-11-27 12:04:21 +00:00
Added option lovebird.echoinput, updated README.md
This commit is contained in:
parent
441d2f5327
commit
d85a4ee47d
@ -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
|
then all the calls to print will also be output to lovebird's console. This is
|
||||||
`true` by default.
|
`true` by default.
|
||||||
|
|
||||||
|
### lovebird.echoinput
|
||||||
|
Whether lovebird should display inputted commands in the console's output
|
||||||
|
buffer; `true` by default.
|
||||||
|
|
||||||
### lovebird.maxlines
|
### lovebird.maxlines
|
||||||
The maximum number of lines lovebird should store in its console's output
|
The maximum number of lines lovebird should store in its console's output
|
||||||
buffer. By default this is `200`.
|
buffer. By default this is `200`.
|
||||||
|
@ -21,6 +21,7 @@ lovebird.pages = {}
|
|||||||
lovebird.wrapprint = true
|
lovebird.wrapprint = true
|
||||||
lovebird.timestamp = true
|
lovebird.timestamp = true
|
||||||
lovebird.allowhtml = false
|
lovebird.allowhtml = false
|
||||||
|
lovebird.echoinput = true
|
||||||
lovebird.port = 8000
|
lovebird.port = 8000
|
||||||
lovebird.whitelist = { "127.0.0.1", "192.168.*.*" }
|
lovebird.whitelist = { "127.0.0.1", "192.168.*.*" }
|
||||||
lovebird.maxlines = 200
|
lovebird.maxlines = 200
|
||||||
@ -32,7 +33,9 @@ lovebird.pages["index"] = [[
|
|||||||
-- Handle console input
|
-- Handle console input
|
||||||
if req.parsedbody.input then
|
if req.parsedbody.input then
|
||||||
local str = req.parsedbody.input
|
local str = req.parsedbody.input
|
||||||
|
if lovebird.echoinput then
|
||||||
lovebird.pushline({ type = 'input', str = str })
|
lovebird.pushline({ type = 'input', str = str })
|
||||||
|
end
|
||||||
xpcall(function() assert(lovebird.loadstring(str, "input"))() end,
|
xpcall(function() assert(lovebird.loadstring(str, "input"))() end,
|
||||||
lovebird.onerror)
|
lovebird.onerror)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user