aboutsummaryrefslogtreecommitdiff
path: root/commands
diff options
context:
space:
mode:
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)
+}