Skip to content

Commit

Permalink
better error message when failing to specify a feature or preset
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Oct 5, 2024
1 parent 95bd915 commit f5a85e2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions agitation-rebalance.lua
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ end
local function do_preset(preset_name)
local preset = presets[preset_name]
if not preset then
qerror('preset not found: ' .. preset_name)
qerror(('preset not found: "%s"'):format(preset_name))
end
utils.assign(custom_difficulty, preset)
print('agitation-rebalance: preset applied: ' .. preset_name)
Expand Down Expand Up @@ -763,7 +763,7 @@ local function enable_feature(which, enabled)
end
local feature = state.features[which]
if feature == nil then
qerror('feature not found: ' .. which)
qerror(('feature not found: "%s"'):format(which))
end
state.features[which] = enabled
print(('feature %sabled: %s'):format(enabled and 'en' or 'dis', which))
Expand All @@ -777,9 +777,9 @@ if dfhack_flags and dfhack_flags.enable then
else do_disable()
end
elseif command == 'preset' then
do_preset(args[1])
do_preset(args[1] or '')
elseif command == 'enable' or command == 'disable' then
enable_feature(args[1], command == 'enable')
enable_feature(args[1] or '', command == 'enable')
elseif not command or command == 'status' then
print_status()
return
Expand Down

0 comments on commit f5a85e2

Please sign in to comment.