From 8266c1f6e79ac25aed83b043521170de64561917 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 3 Oct 2019 00:35:33 -0400 Subject: [PATCH] Add baseCommands --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 5b608c2..ce5c50e 100644 --- a/main.go +++ b/main.go @@ -14,6 +14,7 @@ import ( const cmdPrefix = "/" var commands = make(map[string]Command) +var baseCommands = make([]string) // Configurable section var downloadPath = "/tmp/" @@ -391,8 +392,11 @@ func quit(g *gocui.Gui, v *gocui.View) error { // RegisterCommand registers a command to be used within the client func RegisterCommand(c Command) error { var notAdded string - for _, cmd := range c.Cmd { + for i, cmd := range c.Cmd { if _, ok := commands[cmd]; !ok { + if i == 0 { + baseCommands = append(baseCommands, cmd) + } commands[cmd] = c continue }