summaryrefslogtreecommitdiff
path: root/src/dispatch_table.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/dispatch_table.lua')
-rw-r--r--src/dispatch_table.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/dispatch_table.lua b/src/dispatch_table.lua
index 7783113..1b74624 100644
--- a/src/dispatch_table.lua
+++ b/src/dispatch_table.lua
@@ -32,7 +32,10 @@
dispatch_table = {}
dispatch_table.regex_to_handler = {
- -- TODO basic mode
+ ["%w+%s*\n"] = function(match)
+ command_queue:enqueue(string.match(match , "(%w+)%s*"))
+ end,
+ [".*\n"] = function(match) end
}
function dispatch_table:load_handler_table_file(filename)
@@ -42,9 +45,9 @@ function dispatch_table:load_handler_table_file(filename)
log.printf(log.ERROR, "filename must be of type 'string' and denote a valid path")
return defines.KILL_DAEMON
end
- local chunk = loadfile(filename)
+ local chunk, err = loadfile(filename)
if (not chunk) then
- log.printf(log.ERROR, "failed to load lua-file '%s'", filename)
+ log.printf(log.ERROR, "failed to load dispatch table: %s", err)
return defines.KILL_DAEMON
end
self:register_handler_table(chunk())