------------------------------------
-- Commmand Related Functionality --
------------------------------------
local AddOnName, nsVars = ...
local ss = nsVars.SS

--- Event handler for addon commands. ("/ss")
-- @param msg The text entered after "/ss".
--
local function CommandFunc(msg)
  local cmd, rest = msg:match("^(%S*)%s*(.-)$");
  local restdouble2
  rest, restdouble2 = rest:match("^(%S*)%s*(.-)$");

  if cmd == "nuke" then
    ss:ResetSpheres()
  elseif cmd == "r" then
    ReloadUI()
  else
    ss:ToggleConfig()
  end
end

--setup the slash command stuff, hide the GUI
SlashCmdList["SS"] = CommandFunc
rawset(_G, "SLASH_SS1", "/ss")
