diff options
author | Robin Jarry <robin@jarry.cc> | 2023-10-18 10:24:36 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-10-28 19:25:13 +0200 |
commit | 3f3f5929519195ad018b50733820ac88edc5373a (patch) | |
tree | 47be83c8a3854e87c579ed20c37e90f104a39031 /completer/completer.go | |
parent | abe228b14d97d8d47e8ff4406de387fac45cfe68 (diff) | |
download | aerc-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.go | 7 |
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") } |