aboutsummaryrefslogtreecommitdiffstats
path: root/commands/msgview/next-part.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/msgview/next-part.go')
-rw-r--r--commands/msgview/next-part.go19
1 files changed, 14 insertions, 5 deletions
diff --git a/commands/msgview/next-part.go b/commands/msgview/next-part.go
index fcf8f19f..8f25e02d 100644
--- a/commands/msgview/next-part.go
+++ b/commands/msgview/next-part.go
@@ -8,16 +8,21 @@ import (
"git.sr.ht/~sircmpwn/aerc/widgets"
)
+type NextPrevPart struct{}
+
func init() {
- register("next-part", NextPrevPart)
- register("prev-part", NextPrevPart)
+ register(NextPrevPart{})
}
-func nextPrevPartUsage(cmd string) error {
- return errors.New(fmt.Sprintf("Usage: %s [n]", cmd))
+func (_ NextPrevPart) Aliases() []string {
+ return []string{"next-part", "prev-part"}
+}
+
+func (_ NextPrevPart) Complete(aerc *widgets.Aerc, args []string) []string {
+ return nil
}
-func NextPrevPart(aerc *widgets.Aerc, args []string) error {
+func (_ NextPrevPart) Execute(aerc *widgets.Aerc, args []string) error {
if len(args) > 2 {
return nextPrevPartUsage(args[0])
}
@@ -41,3 +46,7 @@ func NextPrevPart(aerc *widgets.Aerc, args []string) error {
}
return nil
}
+
+func nextPrevPartUsage(cmd string) error {
+ return errors.New(fmt.Sprintf("Usage: %s [n]", cmd))
+}