aboutsummaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
Diffstat (limited to 'commands')
-rw-r--r--commands/msg/fold.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/commands/msg/fold.go b/commands/msg/fold.go
index 06e933d7..f3f55871 100644
--- a/commands/msg/fold.go
+++ b/commands/msg/fold.go
@@ -7,7 +7,9 @@ import (
"git.sr.ht/~rjarry/aerc/lib/ui"
)
-type Fold struct{}
+type Fold struct {
+ Toggle bool `opt:"-t" aliases:"fold,unfold"`
+}
func init() {
register(Fold{})
@@ -17,7 +19,7 @@ func (Fold) Aliases() []string {
return []string{"fold", "unfold"}
}
-func (Fold) Execute(args []string) error {
+func (f Fold) Execute(args []string) error {
h := newHelper()
store, err := h.store()
if err != nil {
@@ -31,9 +33,9 @@ func (Fold) Execute(args []string) error {
switch strings.ToLower(args[0]) {
case "fold":
- err = store.Fold(msg.Uid)
+ err = store.Fold(msg.Uid, f.Toggle)
case "unfold":
- err = store.Unfold(msg.Uid)
+ err = store.Unfold(msg.Uid, f.Toggle)
}
ui.Invalidate()
return err