Skip to content

Commit

Permalink
feat(packages): Provide API for registering commands linked to packages
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Jul 28, 2022
1 parent 5c77e59 commit 4875972
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4875972

Please sign in to comment.