Skip to content

Commit

Permalink
Fix command registration (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
outofforest authored Aug 14, 2024
1 parent 5b3b1e8 commit 84c9a89
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type commandRegistry struct {
commands map[string]Command
}

func (cr commandRegistry) RegisterCommands(commands ...map[string]Command) error {
func (cr commandRegistry) RegisterCommands(commands []map[string]Command) error {
for _, commandSet := range commands {
for path := range commandSet {
if _, exists := cr.commands[path]; exists {
Expand All @@ -43,7 +43,7 @@ func (cr commandRegistry) RegisterCommands(commands ...map[string]Command) error
var defaultCommandRegistry = newCommandRegistry()

// RegisterCommands registers registeredCommands.
func RegisterCommands(commands map[string]Command) {
func RegisterCommands(commands ...map[string]Command) {
if err := defaultCommandRegistry.RegisterCommands(commands); err != nil {
panic(err)
}
Expand Down

0 comments on commit 84c9a89

Please sign in to comment.