diff options
Diffstat (limited to 'commands/quit.go')
-rw-r--r-- | commands/quit.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/commands/quit.go b/commands/quit.go new file mode 100644 index 00000000..34358595 --- /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) +} |