mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-10 08:20:59 +00:00
add testcases for shlexsplit
This commit is contained in:
19
api/internal/plugins/execplugin/shlex.go
Normal file
19
api/internal/plugins/execplugin/shlex.go
Normal file
@@ -0,0 +1,19 @@
|
||||
// Copyright 2019 The Kubernetes Authors.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package execplugin
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
shlex "github.com/carapace-sh/carapace-shlex"
|
||||
)
|
||||
|
||||
func ShlexSplit(s string) ([]string, error) {
|
||||
// return shlexSplit(s)
|
||||
tokens, err := shlex.Split(s)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("shlex split error: %w", err)
|
||||
}
|
||||
return tokens.Strings(), nil
|
||||
}
|
||||
Reference in New Issue
Block a user