aerc/commands/msgview/toggle-headers.go
2019-06-07 09:20:24 -04:00

25 lines
450 B
Go

package msgview
import (
"errors"
"fmt"
"git.sr.ht/~sircmpwn/aerc/widgets"
)
func init() {
register("toggle-headers", ToggleHeaders)
}
func toggleHeadersUsage(cmd string) error {
return errors.New(fmt.Sprintf("Usage: %s", cmd))
}
func ToggleHeaders(aerc *widgets.Aerc, args []string) error {
if len(args) > 1 {
return toggleHeadersUsage(args[0])
}
mv, _ := aerc.SelectedTab().(*widgets.MessageViewer)
mv.ToggleHeaders()
return nil
}