aboutsummaryrefslogtreecommitdiffstats
path: root/commands/account
diff options
context:
space:
mode:
Diffstat (limited to 'commands/account')
-rw-r--r--commands/account/mkdir.go10
-rw-r--r--commands/account/recover.go2
-rw-r--r--commands/account/search.go6
-rw-r--r--commands/account/sort.go2
4 files changed, 12 insertions, 8 deletions
diff --git a/commands/account/mkdir.go b/commands/account/mkdir.go
index 3e546ace..af3d1045 100644
--- a/commands/account/mkdir.go
+++ b/commands/account/mkdir.go
@@ -7,6 +7,7 @@ import (
"git.sr.ht/~rjarry/aerc/app"
"git.sr.ht/~rjarry/aerc/commands"
"git.sr.ht/~rjarry/aerc/worker/types"
+ "git.sr.ht/~rjarry/go-opt"
)
type MakeDir struct {
@@ -26,10 +27,13 @@ func (*MakeDir) CompleteFolder(arg string) []string {
if acct == nil {
return nil
}
+ sep := app.SelectedAccount().Worker().PathSeparator()
return commands.FilterList(
- acct.Directories().List(), arg, "",
- app.SelectedAccount().Worker().PathSeparator(),
- app.SelectedAccountUiConfig().FuzzyComplete)
+ acct.Directories().List(), arg,
+ func(s string) string {
+ return opt.QuoteArg(s) + sep
+ },
+ )
}
func (m MakeDir) Execute(args []string) error {
diff --git a/commands/account/recover.go b/commands/account/recover.go
index cba6e0cb..a2170edd 100644
--- a/commands/account/recover.go
+++ b/commands/account/recover.go
@@ -39,7 +39,7 @@ func (*Recover) CompleteFile(arg string) []string {
if err != nil {
return nil
}
- return commands.CompletionFromList(files, arg)
+ return commands.FilterList(files, arg, nil)
}
func (r Recover) Execute(args []string) error {
diff --git a/commands/account/search.go b/commands/account/search.go
index ca1b9684..10481e8e 100644
--- a/commands/account/search.go
+++ b/commands/account/search.go
@@ -42,15 +42,15 @@ func (SearchFilter) Aliases() []string {
}
func (*SearchFilter) CompleteFlag(arg string) []string {
- return commands.CompletionFromList(commands.GetFlagList(), arg)
+ return commands.FilterList(commands.GetFlagList(), arg, commands.QuoteSpace)
}
func (*SearchFilter) CompleteAddress(arg string) []string {
- return commands.CompletionFromList(commands.GetAddress(arg), arg)
+ return commands.FilterList(commands.GetAddress(arg), arg, commands.QuoteSpace)
}
func (*SearchFilter) CompleteDate(arg string) []string {
- return commands.CompletionFromList(commands.GetDateList(), arg)
+ return commands.FilterList(commands.GetDateList(), arg, commands.QuoteSpace)
}
func (s *SearchFilter) ParseRead(arg string) error {
diff --git a/commands/account/sort.go b/commands/account/sort.go
index ccccab25..3103a388 100644
--- a/commands/account/sort.go
+++ b/commands/account/sort.go
@@ -38,7 +38,7 @@ var supportedCriteria = []string{
}
func (*Sort) CompleteCriteria(arg string) []string {
- return commands.CompletionFromList(supportedCriteria, arg)
+ return commands.FilterList(supportedCriteria, arg, commands.QuoteSpace)
}
func (Sort) Execute(args []string) error {