Skip to content

Commit f5a85e2

Browse files
committed
better error message when failing to specify a feature or preset
1 parent 95bd915 commit f5a85e2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

agitation-rebalance.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ end
326326
local function do_preset(preset_name)
327327
local preset = presets[preset_name]
328328
if not preset then
329-
qerror('preset not found: ' .. preset_name)
329+
qerror(('preset not found: "%s"'):format(preset_name))
330330
end
331331
utils.assign(custom_difficulty, preset)
332332
print('agitation-rebalance: preset applied: ' .. preset_name)
@@ -763,7 +763,7 @@ local function enable_feature(which, enabled)
763763
end
764764
local feature = state.features[which]
765765
if feature == nil then
766-
qerror('feature not found: ' .. which)
766+
qerror(('feature not found: "%s"'):format(which))
767767
end
768768
state.features[which] = enabled
769769
print(('feature %sabled: %s'):format(enabled and 'en' or 'dis', which))
@@ -777,9 +777,9 @@ if dfhack_flags and dfhack_flags.enable then
777777
else do_disable()
778778
end
779779
elseif command == 'preset' then
780-
do_preset(args[1])
780+
do_preset(args[1] or '')
781781
elseif command == 'enable' or command == 'disable' then
782-
enable_feature(args[1], command == 'enable')
782+
enable_feature(args[1] or '', command == 'enable')
783783
elseif not command or command == 'status' then
784784
print_status()
785785
return

0 commit comments

Comments
 (0)