CC_Core = AceLibrary("AceAddon-2.0"):new("AceEvent-2.0", "AceHook-2.0", "AceDebug-2.0", "AceConsole-2.0","AceModuleCore-2.0") CC_Core.consoleCmd = { "/cc" } CC_Core.consoleOptions = { type="group", args = { test = { desc = "test", func = "Test", type = "execute", name = "Test", }, }, } function CC_Core:OnInitialize() self:RegisterChatCommand(self.consoleCmd, self.consoleOptions) self:SetDebugging(true) end function CC_Core:Test() self:Debug("CC_Core:Test") end function CC_Core:OnEnable() self:Debug("CC_Core:OnEnable") for name,module in self:IterateModules() do self:Debug(name); if module.consoleOptions then self.consoleOptions.args[module.consoleCmd] = module.consoleOptions end end end function CC_Core:OnDisable() end -- Module (CC_Tooltip.lua): CC_ToolTip = CC_Core:NewModule("CC_ToolTip") CC_ToolTip.consoleCmd = "tooltip" CC_ToolTip.consoleOptions = { type="group", name = "ToolTip", desc = "Options for ToolTip.", args = { ["test"] = { desc = "test", func = "Test", type = "execute", name = "Test", }, }, } function CC_ToolTip:Test() self:Debug("CC_ToolTip:Test has been called") end