Add :quit command
This commit is contained in:
parent
22f453f56a
commit
f406bf5a3b
3 changed files with 35 additions and 8 deletions
commands
24
commands/quit.go
Normal file
24
commands/quit.go
Normal file
|
@ -0,0 +1,24 @@
|
|||
package commands
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"git.sr.ht/~sircmpwn/aerc2/widgets"
|
||||
)
|
||||
|
||||
func init() {
|
||||
Register("quit", ChangeQuit)
|
||||
}
|
||||
|
||||
type ErrorExit int
|
||||
|
||||
func (err ErrorExit) Error() string {
|
||||
return "exit"
|
||||
}
|
||||
|
||||
func ChangeQuit(aerc *widgets.Aerc, args []string) error {
|
||||
if len(args) != 1 {
|
||||
return errors.New("Usage: quit")
|
||||
}
|
||||
return ErrorExit(1)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue