This will handle two variables entered for a command.
Code:
function GmTool_OnLoad()
SlashCmdList["GMTOOL"] = GmTool_perso_Slash;
SLASH_GMTOOL1 = "/gt";
end
function GmTool_perso_Slash(msg)
local Cmd, Sub = GmTool_GetCmd(msg);
if (Cmd and Sub) then
DEFAULT_CHAT_FRAME:AddMessage(Cmd);
DEFAULT_CHAT_FRAME:AddMessage(Sub);
end
end
function GmTool_GetCmd(msg)
if (msg) then
local a,b,c=strfind(msg, "(%S+)");
if a then
return c, strsub(msg, b+2);
else
return "";
end
end
end