Skip to content

Commit ed203d0

Browse files
committed
Added --quiet / -q flag to fix/dry-buckets
1 parent d845ac9 commit ed203d0

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

fix/dry-buckets.lua

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1+
local argparse = require("argparse")
2+
3+
local quiet = false
4+
15
local emptied = 0
26
local in_building = 0
37
local water_type = dfhack.matinfo.find('WATER').type
48

9+
argparse.processArgsGetopt({...}, {
10+
{'q', 'quiet', handler=function() quiet = true end},
11+
})
12+
513
for _,item in ipairs(df.global.world.items.other.IN_PLAY) do
614
local container = dfhack.items.getContainer(item)
715
if container
@@ -19,7 +27,9 @@ for _,item in ipairs(df.global.world.items.other.IN_PLAY) do
1927
end
2028
end
2129

22-
print('Emptied '..emptied..' buckets.')
23-
if emptied > 0 then
24-
print(('Unclogged %d wells.'):format(in_building))
30+
if not quiet then
31+
print('Emptied '..emptied..' buckets.')
32+
if emptied > 0 then
33+
print(('Unclogged %d wells.'):format(in_building))
34+
end
2535
end

internal/control-panel/registry.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ COMMANDS_BY_IDX = {
7373
params={'--time', '7', '--timeUnits', 'days', '--command', '[', 'fix/dead-units', '--burrow', '-q', ']'}},
7474
{command='fix/dry-buckets', group='bugfix', mode='repeat', default=true,
7575
desc='Allow discarded water buckets to be used again.',
76-
params={'--time', '7', '--timeUnits', 'days', '--command', '[', 'fix/dry-buckets', ']'}},
76+
params={'--time', '7', '--timeUnits', 'days', '--command', '[', 'fix/dry-buckets', '-q', ']'}},
7777
{command='fix/empty-wheelbarrows', group='bugfix', mode='repeat', default=true,
7878
desc='Make abandoned full wheelbarrows usable again.',
7979
params={'--time', '1', '--timeUnits', 'days', '--command', '[', 'fix/empty-wheelbarrows', '-q', ']'}},

0 commit comments

Comments
 (0)