diff options
author | Drew DeVault <sir@cmpwn.com> | 2019-03-15 20:32:09 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-03-15 20:32:09 -0400 |
commit | f406bf5a3bb953426a00f2feac1f2863a29ab269 (patch) | |
tree | 70b1c238bae590b7f1814840ba303faa1532d8cb /aerc.go | |
parent | 22f453f56a18da91c987baa3a47fa91f666d8b7a (diff) | |
download | aerc-f406bf5a3bb953426a00f2feac1f2863a29ab269.tar.gz |
Add :quit command
Diffstat (limited to 'aerc.go')
-rw-r--r-- | aerc.go | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -33,12 +33,20 @@ func main() { panic(err) } - var aerc *widgets.Aerc + var ( + aerc *widgets.Aerc + ui *libui.UI + ) aerc = widgets.NewAerc(conf, logger, func(cmd string) error { - return commands.ExecuteCommand(aerc, cmd) + err = commands.ExecuteCommand(aerc, cmd) + if _, ok := err.(commands.ErrorExit); ok { + ui.Exit = true + return nil + } + return err }) - ui, err := libui.Initialize(conf, aerc) + ui, err = libui.Initialize(conf, aerc) if err != nil { panic(err) } |