aboutsummaryrefslogtreecommitdiffstats
path: root/completer/completer.go
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2023-10-18 10:24:36 +0200
committerRobin Jarry <robin@jarry.cc>2023-10-28 19:25:13 +0200
commit3f3f5929519195ad018b50733820ac88edc5373a (patch)
tree47be83c8a3854e87c579ed20c37e90f104a39031 /completer/completer.go
parentabe228b14d97d8d47e8ff4406de387fac45cfe68 (diff)
downloadaerc-3f3f5929519195ad018b50733820ac88edc5373a.tar.gz
treewide: replace shlex.Split with opt.SplitArgs
Replace the remaining shlex.Split calls with opt.SplitArgs. Remove dependency to shlex. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Koni Marti <koni.marti@gmail.com> Tested-by: Moritz Poldrack <moritz@poldrack.dev> Tested-by: Inwit <inwit@sindominio.net>
Diffstat (limited to 'completer/completer.go')
-rw-r--r--completer/completer.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/completer/completer.go b/completer/completer.go
index 9b237fa8..647e9ed7 100644
--- a/completer/completer.go
+++ b/completer/completer.go
@@ -13,7 +13,7 @@ import (
"syscall"
"git.sr.ht/~rjarry/aerc/log"
- "github.com/google/shlex"
+ "git.sr.ht/~rjarry/go-opt"
)
// A Completer is used to autocomplete text inputs based on the configured
@@ -142,10 +142,7 @@ func (c *Completer) getAddressCmd(s string) (*exec.Cmd, error) {
return nil, fmt.Errorf("no command configured")
}
queryCmd := strings.ReplaceAll(c.AddressBookCmd, "%s", s)
- parts, err := shlex.Split(queryCmd)
- if err != nil {
- return nil, fmt.Errorf("could not lex command")
- }
+ parts := opt.SplitArgs(queryCmd)
if len(parts) < 1 {
return nil, fmt.Errorf("empty command")
}