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

Function CmdFromString

shell/4/shell.go:56–62  ·  view source on GitHub ↗
(cmdLine string)

Source from the content-addressed store, hash-verified

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

Callers 1

RunMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected