Skip to content

Commit 73b6432

Browse files
committed
Add a variant of printall() that uses ipairs
1 parent 4c8b5c1 commit 73b6432

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lua.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ elseif cmd=="--save" or cmd=="-s" then
2323
elseif cmd~=nil then
2424
-- Support some of the prefixes allowed by dfhack.interpreter
2525
local prefix
26-
if string.match(cmd, "^[~!]") then
26+
if string.match(cmd, "^[~@!]") then
2727
prefix = string.sub(cmd, 1, 1)
2828
cmd = 'return '..string.sub(cmd, 2)
2929
end
@@ -39,6 +39,8 @@ elseif cmd~=nil then
3939
print(table.unpack(rv,2,rv.n))
4040
if prefix == '~' then
4141
printall(rv[2])
42+
elseif prefix == '@' then
43+
printall_ipairs(rv[2])
4244
end
4345
end
4446
else

0 commit comments

Comments
 (0)