Add terminal command context

This commit is contained in:
Drew DeVault 2019-03-21 16:32:22 -04:00
parent 8126d82956
commit 10dd23f05d
3 changed files with 26 additions and 5 deletions
commands/terminal

View file

@ -1,4 +1,4 @@
package commands
package terminal
import (
"errors"
@ -7,11 +7,10 @@ import (
)
func init() {
// TODO: Move this command into a terminal-specific command set
register("close", TermClose)
register("close", CommandClose)
}
func TermClose(aerc *widgets.Aerc, args []string) error {
func CommandClose(aerc *widgets.Aerc, args []string) error {
if len(args) != 1 {
return errors.New("Usage: close")
}

View file

@ -0,0 +1,16 @@
package terminal
import (
"git.sr.ht/~sircmpwn/aerc2/commands"
)
var (
TerminalCommands *commands.Commands
)
func register(name string, cmd commands.AercCommand) {
if TerminalCommands == nil {
TerminalCommands = commands.NewCommands()
}
TerminalCommands.Register(name, cmd)
}