diff --git a/cmdHelp.go b/cmdHelp.go index 89d0860..755ae9b 100644 --- a/cmdHelp.go +++ b/cmdHelp.go @@ -5,8 +5,6 @@ package main import ( "fmt" "sort" - - "github.com/jroimartin/gocui" ) func init() { @@ -20,7 +18,7 @@ func init() { RegisterCommand(command) } -func cmdHelp(g *gocui.Gui, cmd []string) { +func cmdHelp(cmd []string) { var helpText string if len(cmd) == 1 { sort.Strings(baseCommands) diff --git a/cmdJoin.go b/cmdJoin.go index 4b8cbb8..7306862 100644 --- a/cmdJoin.go +++ b/cmdJoin.go @@ -5,7 +5,6 @@ package main import ( "fmt" - "github.com/jroimartin/gocui" "samhofi.us/x/keybase" ) @@ -20,7 +19,7 @@ func init() { RegisterCommand(command) } -func cmdJoin(g *gocui.Gui, cmd []string) { +func cmdJoin(cmd []string) { stream = false if len(cmd) == 3 { channel.MembersType = keybase.TEAM diff --git a/cmdUploadFile.go b/cmdUploadFile.go index c6420b2..8ea3bc4 100644 --- a/cmdUploadFile.go +++ b/cmdUploadFile.go @@ -4,8 +4,6 @@ package main import ( "fmt" - - "github.com/jroimartin/gocui" ) func init() { @@ -19,7 +17,7 @@ func init() { RegisterCommand(command) } -func cmdUploadFile(g *gocui.Gui, cmd []string) { +func cmdUploadFile(cmd []string) { filePath := cmd[1] var fileName string if len(cmd) == 3 { diff --git a/main.go b/main.go index f4e03fb..ee930eb 100644 --- a/main.go +++ b/main.go @@ -352,7 +352,7 @@ func handleInput() error { if strings.HasPrefix(inputString, cmdPrefix) { cmd := strings.Split(inputString[len(cmdPrefix):], " ") if c, ok := commands[cmd[0]]; ok { - c.Exec(g, cmd) + c.Exec(cmd) return nil } else if cmd[0] == "q" || cmd[0] == "quit" { return gocui.ErrQuit @@ -395,5 +395,5 @@ func RegisterCommand(c Command) error { // RunCommand calls a command as if it was run by the user func RunCommand(c ...string) { - commands[c[0]].Exec(g, c) + commands[c[0]].Exec(c) } diff --git a/types.go b/types.go index 1c1dcb3..d385b47 100644 --- a/types.go +++ b/types.go @@ -1,13 +1,9 @@ package main -import ( - "github.com/jroimartin/gocui" -) - // Command outlines a command type Command struct { - Cmd []string // Any aliases that trigger this command - Description string // A short description of the command - Help string // The full help text explaining how to use the command - Exec func(*gocui.Gui, []string) // A function that takes the command (arg[0]) and any arguments (arg[1:]) as input + Cmd []string // Any aliases that trigger this command + Description string // A short description of the command + Help string // The full help text explaining how to use the command + Exec func([]string) // A function that takes the command (arg[0]) and any arguments (arg[1:]) as input }