Files
kustomize/api/internal/plugins/execplugin/shlex.go
2025-07-12 07:14:17 +09:00

20 lines
378 B
Go

// 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
}