Summary
When attempting to switch active profiles using /rfg profile <name>, profile names with spaces (e.g., /rfg profile Two Words) fail to be selected. Instead of loading the profile, the command prints the usage instructions. Since auto generated profiles include whitespaces, this bug makes creating macros to change to them impossible.
Location
File: Compare/10_config.lua (lines 336–352)
Cause
In SlashCmdList.REFACTORGEAR, line 336 parses rest using rest:match("^(%S*)%s*(.-)$") to extract sub and name:
local sub, name = rest:match("^(%S*)%s*(.-)$")
For /rfg profile Two Words:
sub becomes "Two"
name becomes "Words"
When checking whether sub is a standalone profile name:
elseif sub ~= "" and name == "" then
The check fails because name is "Words" instead of "". Because no preceding sub-commands (list, save, delete) matched either, execution falls through to the final else block, displaying the profile usage string.
Steps to Reproduce
- Create a profile containing a space (e.g.,
/rfg profile save Two Words).
- Switch to a different profile.
- Attempt to load the original profile using
/rfg profile Two Words.
- Observe that the command prints
usage: /rfg profile <name> | save <name> | delete <name> | list instead of switching profiles.
Suggested Fix
Update the fallback branch in the cmd == "profile" block to inspect rest directly rather than requiring name == "":
elseif subl == "delete" and name ~= "" then
if RefactorGearDB.profiles[name] then
DeleteProfile(name)
else
Print("no profile named '" .. name .. "'.")
end
elseif rest ~= "" then
if RefactorGearDB.profiles[rest] then
SetActiveProfile(rest)
C.RefreshOpenBags()
C.RefreshConfig()
Print("switched to profile '" .. rest .. "'.")
else
Print("no profile named '" .. rest .. "'. /rfg profile save " .. rest .. " to create it.")
end
else
Print("usage: /rfg profile <name> | save <name> | delete <name> | list")
end
Summary
When attempting to switch active profiles using
/rfg profile <name>, profile names with spaces (e.g.,/rfg profile Two Words) fail to be selected. Instead of loading the profile, the command prints the usage instructions. Since auto generated profiles include whitespaces, this bug makes creating macros to change to them impossible.Location
File:
Compare/10_config.lua(lines 336–352)Cause
In
SlashCmdList.REFACTORGEAR, line 336 parsesrestusingrest:match("^(%S*)%s*(.-)$")to extractsubandname:For
/rfg profile Two Words:subbecomes"Two"namebecomes"Words"When checking whether
subis a standalone profile name:The check fails because
nameis"Words"instead of"". Because no preceding sub-commands (list,save,delete) matched either, execution falls through to the finalelseblock, displaying the profile usage string.Steps to Reproduce
/rfg profile save Two Words)./rfg profile Two Words.usage: /rfg profile <name> | save <name> | delete <name> | listinstead of switching profiles.Suggested Fix
Update the fallback branch in the
cmd == "profile"block to inspectrestdirectly rather than requiringname == "":