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

Function CmdFromString

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

Source from the content-addressed store, hash-verified

49}
50
51func CmdFromString(cmdLine string) (*exec.Cmd, error) {
52 args := strings.Fields(cmdLine)
53 if len(args) < 1 {
54 return nil, errors.New("empty input")
55 }
56 return exec.Command(args[0], args[1:]...), nil
57}
58
59func Main() {
60 session := NewSession(os.Stdin, os.Stdout, os.Stderr)

Callers 1

RunMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected