From 4875972c6942db2901c51fa4955e36df5d850466 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Fri, 29 Jul 2022 01:12:09 +0300 Subject: [PATCH] feat(packages): Provide API for registering commands linked to packages --- packages/base.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/base.lua b/packages/base.lua index 6110e3614..bf07066da 100644 --- a/packages/base.lua +++ b/packages/base.lua @@ -28,6 +28,12 @@ function package.registerRawHandlers (_) end function package.registerCommands (_) end +-- This gives us a hook to match commands with the packages that registered +-- them as opposed to core commands or class-provided commands +function package:registerCommand (name, func, help, pack) + self.class:registerCommand(name, func, help, pack) +end + -- Using this rather than doing the work directly will give us a way to -- un-export them if we ever need to unload modules and revert functions function package:export (name, func)