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
function dfhack.run_command(...)
local output, status = _run_command(...)
for i, fragment in pairs(output) do
if type(fragment) == 'table' then
dfhack.color(fragment[1])
dfhack.print(fragment[2])
local result = _run_command(...)
for i, f in pairs(result) do
if type(f) == 'table' then
dfhack.color(f[1])
dfhack.print(f[2])
end
end
dfhack.color(COLOR_RESET)
return result.status
end
-- Per-save init file