aboutsummaryrefslogtreecommitdiffstats
path: root/commands/compose/switch.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/compose/switch.go')
-rw-r--r--commands/compose/switch.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/commands/compose/switch.go b/commands/compose/switch.go
index 0c027a41..637099b5 100644
--- a/commands/compose/switch.go
+++ b/commands/compose/switch.go
@@ -4,6 +4,7 @@ import (
"errors"
"git.sr.ht/~rjarry/aerc/app"
+ "git.sr.ht/~rjarry/aerc/commands"
)
type AccountSwitcher interface {
@@ -13,7 +14,7 @@ type AccountSwitcher interface {
type SwitchAccount struct {
Next bool `opt:"-n"`
Prev bool `opt:"-p"`
- Account string `opt:"..." metavar:"<account>" required:"false"`
+ Account string `opt:"account" required:"false" complete:"CompleteAccount"`
}
func init() {
@@ -24,8 +25,8 @@ func (SwitchAccount) Aliases() []string {
return []string{"switch-account"}
}
-func (SwitchAccount) Complete(args []string) []string {
- return app.AccountNames()
+func (*SwitchAccount) CompleteAccount(arg string) []string {
+ return commands.CompletionFromList(app.AccountNames(), arg)
}
func (s SwitchAccount) Execute(args []string) error {