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