summary refs log tree commit diff stats
path: root/commands
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-03-15 20:32:09 -0400
committerDrew DeVault <sir@cmpwn.com>2019-03-15 20:32:09 -0400
commitf406bf5a3bb953426a00f2feac1f2863a29ab269 (patch)
tree70b1c238bae590b7f1814840ba303faa1532d8cb /commands
parent22f453f56a18da91c987baa3a47fa91f666d8b7a (diff)
downloadaerc-f406bf5a3bb953426a00f2feac1f2863a29ab269.tar.gz
Add :quit command
Diffstat (limited to 'commands')
-rw-r--r--commands/quit.go24
1 files changed, 24 insertions, 0 deletions
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)
+}