dfhack/scripts/lua.lua

10 lines
298 B
Lua

local args={...}
if args[1]=="--file" or args[1]=="-f" then
local f=loadfile (args[2])
dfhack.pcall(f,table.unpack(args,3))
elseif args[1]~=nil then
2012-09-25 01:24:45 -06:00
local f=load(args[1],'=(lua command)', 't')
dfhack.pcall(f,table.unpack(args,2))
else
dfhack.interpreter("lua","lua.history")
end