From f406bf5a3bb953426a00f2feac1f2863a29ab269 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 15 Mar 2019 20:32:09 -0400 Subject: Add :quit command --- commands/quit.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 commands/quit.go (limited to 'commands') diff --git a/commands/quit.go b/commands/quit.go new file mode 100644 index 0000000..3435859 --- /dev/null +++ b/commands/quit.go @@ -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) +} -- cgit 1.4.1-2-gfad0