MCPcopy Create free account
hub / github.com/bitfield/tpg-tools2 / CmdFromString

Function CmdFromString

shell/1/shell.go:9–15  ·  view source on GitHub ↗
(cmdLine string)

Source from the content-addressed store, hash-verified

7)
8
9func CmdFromString(cmdLine string) (*exec.Cmd, error) {
10 args := strings.Fields(cmdLine)
11 if len(args) < 1 {
12 return nil, errors.New("empty input")
13 }
14 return exec.Command(args[0], args[1:]...), nil
15}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected