about summary refs log tree commit diff stats
path: root/commands/account/next-result.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/account/next-result.go')
-rw-r--r--commands/account/next-result.go19
1 files changed, 14 insertions, 5 deletions
diff --git a/commands/account/next-result.go b/commands/account/next-result.go
index d89de56..24d53be 100644
--- a/commands/account/next-result.go
+++ b/commands/account/next-result.go
@@ -7,16 +7,21 @@ import (
 	"git.sr.ht/~sircmpwn/aerc/widgets"
 )
 
+type NextPrevResult struct{}
+
 func init() {
-	register("next-result", NextPrevResult)
-	register("prev-result", NextPrevResult)
+	register(NextPrevResult{})
 }
 
-func nextPrevResultUsage(cmd string) error {
-	return errors.New(fmt.Sprintf("Usage: %s [<n>[%%]]", cmd))
+func (_ NextPrevResult) Aliases() []string {
+	return []string{"next-result", "prev-result"}
+}
+
+func (_ NextPrevResult) Complete(aerc *widgets.Aerc, args []string) []string {
+	return nil
 }
 
-func NextPrevResult(aerc *widgets.Aerc, args []string) error {
+func (_ NextPrevResult) Execute(aerc *widgets.Aerc, args []string) error {
 	if len(args) > 1 {
 		return nextPrevResultUsage(args[0])
 	}
@@ -39,3 +44,7 @@ func NextPrevResult(aerc *widgets.Aerc, args []string) error {
 	}
 	return nil
 }
+
+func nextPrevResultUsage(cmd string) error {
+	return errors.New(fmt.Sprintf("Usage: %s [<n>[%%]]", cmd))
+}