Revert "add close command at global level"

This reverts commit f0a0c5aa73.
This commit is contained in:
Drew DeVault 2019-08-13 10:55:50 +09:00
parent f0a0c5aa73
commit 4fc6fee734
6 changed files with 100 additions and 72 deletions
commands/terminal

View file

@ -0,0 +1,30 @@
package terminal
import (
"errors"
"git.sr.ht/~sircmpwn/aerc/widgets"
)
type Close struct{}
func init() {
register(Close{})
}
func (_ Close) Aliases() []string {
return []string{"close"}
}
func (_ Close) Complete(aerc *widgets.Aerc, args []string) []string {
return nil
}
func (_ Close) Execute(aerc *widgets.Aerc, args []string) error {
if len(args) != 1 {
return errors.New("Usage: close")
}
term, _ := aerc.SelectedTab().(*widgets.Terminal)
term.Close(nil)
return nil
}