MCPcopy Create free account
hub / github.com/cogentcore/core / OutToPipe

Method OutToPipe

shell/exec.go:294–309  ·  view source on GitHub ↗

OutToPipe processes the | arg that sends output to a pipe

(cl *sshclient.Client, cmdIO *exec.CmdIO, errOk bool, sargs []string, i int)

Source from the content-addressed store, hash-verified

292
293// OutToPipe processes the | arg that sends output to a pipe
294func (sh *Shell) OutToPipe(cl *sshclient.Client, cmdIO *exec.CmdIO, errOk bool, sargs []string, i int) []string {
295 s := sargs[i]
296 sn := len(s)
297 errf := false
298 if sn > 1 && s[1] == '&' {
299 errf = true
300 }
301 // todo: what to do here?
302 sargs = slices.Delete(sargs, i, i+1)
303 cmdIO.PushOutPipe()
304 if errf {
305 cmdIO.PushErr(cmdIO.Out)
306 }
307 // sh.HandleArgErr(errok, err)
308 return sargs
309}
310
311// CmdArgs processes expressions involving "args" for commands
312func (sh *Shell) CmdArgs(errOk bool, sargs []string, i int) []string {

Callers 1

ExecArgsMethod · 0.95

Calls 3

PushOutPipeMethod · 0.80
PushErrMethod · 0.80
DeleteMethod · 0.65

Tested by

no test coverage detected