aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--commands/account/search.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/commands/account/search.go b/commands/account/search.go
index 71833afd..d7884f15 100644
--- a/commands/account/search.go
+++ b/commands/account/search.go
@@ -4,6 +4,7 @@ import (
"errors"
"strings"
+ "git.sr.ht/~rjarry/aerc/commands"
"git.sr.ht/~rjarry/aerc/lib/state"
"git.sr.ht/~rjarry/aerc/lib/ui"
"git.sr.ht/~rjarry/aerc/log"
@@ -17,10 +18,32 @@ func init() {
register(SearchFilter{})
}
+func (SearchFilter) Options() string {
+ return "rubax:X:t:H:f:c:d:"
+}
+
func (SearchFilter) Aliases() []string {
return []string{"search", "filter"}
}
+func (s SearchFilter) CompleteOption(
+ aerc *widgets.Aerc,
+ r rune,
+ search string,
+) []string {
+ var valid []string
+ switch r {
+ case 'x', 'X':
+ valid = commands.GetFlagList()
+ case 't', 'f', 'c':
+ valid = commands.GetAddress(aerc, search)
+ case 'd':
+ valid = commands.GetDateList()
+ default:
+ }
+ return commands.CompletionFromList(aerc, valid, []string{search})
+}
+
func (SearchFilter) Complete(aerc *widgets.Aerc, args []string) []string {
return nil
}