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

Function CmdFromString

shell/2/shell.go:45–51  ·  view source on GitHub ↗
(cmdLine string)

Source from the content-addressed store, hash-verified

43}
44
45func CmdFromString(cmdLine string) (*exec.Cmd, error) {
46 args := strings.Fields(cmdLine)
47 if len(args) < 1 {
48 return nil, errors.New("empty input")
49 }
50 return exec.Command(args[0], args[1:]...), nil
51}
52
53func Main() {
54 session := NewSession(os.Stdin, os.Stdout, os.Stderr)

Callers 1

RunMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected