summary refs log tree commit diff stats
path: root/commands
diff options
context:
space:
mode:
Diffstat (limited to 'commands')
-rw-r--r--commands/msgview/toggle-headers.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/commands/msgview/toggle-headers.go b/commands/msgview/toggle-headers.go
new file mode 100644
index 0000000..fc29042
--- /dev/null
+++ b/commands/msgview/toggle-headers.go
@@ -0,0 +1,25 @@
+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
+}