summaryrefslogtreecommitdiff
path: root/src/command_table.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/command_table.lua')
-rw-r--r--src/command_table.lua21
1 files changed, 2 insertions, 19 deletions
diff --git a/src/command_table.lua b/src/command_table.lua
index f663df3..e3e6b42 100644
--- a/src/command_table.lua
+++ b/src/command_table.lua
@@ -38,29 +38,12 @@ command_table.regex_to_handler = {
[".*\n"] = function(match) end
}
-function command_table:load_handler_table_file(filename)
- local defines = require('defines')
- if (type(filename) ~= "nil") then
- if (type(filename) ~= "string") then
- log.printf(log.ERROR, "filename must be of type 'string' and denote a valid path")
- return defines.KILL_DAEMON
- end
- local chunk, err = loadfile(filename)
- if (not chunk) then
- log.printf(log.ERROR, "failed to load dispatch table: %s", err)
- return defines.KILL_DAEMON
- end
- self:register_handler_table(chunk())
- log.printf(log.NOTICE, "loaded dispatch table from file %s", filename)
- end
- return defines.OK
-end
-
function command_table:register_handler_table(handler_table)
if (type(handler_table) ~= "table") then
- error("handler_table must be of type 'table'")
+ error("command handler_table must be of type 'table'")
end
self.regex_to_handler = handler_table
+ log.printf(log.DEBUG, "loaded new command handler table")
end
function command_table:dispatch(command_buffer)