Skip to content

Commit 96d8dff

Browse files
committed
Make dfhack.run_command return the command_result value.
Rename local variables to match dfhack.run_command_silent for clarity.
1 parent 47fa9e1 commit 96d8dff

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

library/lua/dfhack.lua

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -765,14 +765,15 @@ function dfhack.run_command_silent(...)
765765
end
766766

767767
function dfhack.run_command(...)
768-
local output, status = _run_command(...)
769-
for i, fragment in pairs(output) do
770-
if type(fragment) == 'table' then
771-
dfhack.color(fragment[1])
772-
dfhack.print(fragment[2])
768+
local result = _run_command(...)
769+
for i, f in pairs(result) do
770+
if type(f) == 'table' then
771+
dfhack.color(f[1])
772+
dfhack.print(f[2])
773773
end
774774
end
775775
dfhack.color(COLOR_RESET)
776+
return result.status
776777
end
777778

778779
-- Per-save init file

0 commit comments

Comments
 (0)