From 3f3f5929519195ad018b50733820ac88edc5373a Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Wed, 18 Oct 2023 10:24:36 +0200 Subject: 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 Reviewed-by: Koni Marti Tested-by: Moritz Poldrack Tested-by: Inwit --- completer/completer.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'completer/completer.go') 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") } -- cgit