summary refs log tree commit diff stats
path: root/commands/commands.go
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-03-14 22:34:34 -0400
committerDrew DeVault <sir@cmpwn.com>2019-03-14 22:34:34 -0400
commit62946ff6c5712bebf7f07a83fc077d40db0e73a8 (patch)
treed135e824abb0faf5d2a0baa70a0ae6b9bb8b5ebc /commands/commands.go
parentde364846ccaba3b93c383add3846443048f1c2c9 (diff)
downloadaerc-62946ff6c5712bebf7f07a83fc077d40db0e73a8.tar.gz
Implement :cd command
Diffstat (limited to 'commands/commands.go')
-rw-r--r--commands/commands.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/commands/commands.go b/commands/commands.go
index 49a8b46..2890cdd 100644
--- a/commands/commands.go
+++ b/commands/commands.go
@@ -14,11 +14,10 @@ var (
 	commands map[string]AercCommand
 )
 
-func init() {
-	commands = make(map[string]AercCommand)
-}
-
 func Register(name string, cmd AercCommand) {
+	if commands == nil {
+		commands = make(map[string]AercCommand)
+	}
 	commands[name] = cmd
 }