Make dfhack.run_command return the command_result value.

Rename local variables to match dfhack.run_command_silent for clarity.
develop
Ben Lubar 2020-01-14 17:53:52 -06:00
parent 47fa9e1159
commit 96d8dffd32
No known key found for this signature in database
GPG Key ID: 92939677AB59EDA4
1 changed files with 6 additions and 5 deletions

@ -765,14 +765,15 @@ function dfhack.run_command_silent(...)
end end
function dfhack.run_command(...) function dfhack.run_command(...)
local output, status = _run_command(...) local result = _run_command(...)
for i, fragment in pairs(output) do for i, f in pairs(result) do
if type(fragment) == 'table' then if type(f) == 'table' then
dfhack.color(fragment[1]) dfhack.color(f[1])
dfhack.print(fragment[2]) dfhack.print(f[2])
end end
end end
dfhack.color(COLOR_RESET) dfhack.color(COLOR_RESET)
return result.status
end end
-- Per-save init file -- Per-save init file