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

Method CmdArgs

shell/exec.go:312–327  ·  view source on GitHub ↗

CmdArgs processes expressions involving "args" for commands

(errOk bool, sargs []string, i int)

Source from the content-addressed store, hash-verified

310
311// CmdArgs processes expressions involving "args" for commands
312func (sh *Shell) CmdArgs(errOk bool, sargs []string, i int) []string {
313 // n := len(sargs)
314 // s := sargs[i]
315 // sn := len(s)
316 args := sh.commandArgs.Peek()
317
318 // fmt.Println("command args:", args)
319
320 switch {
321 case sargs[i] == "args...":
322 sargs = slices.Delete(sargs, i, i+1)
323 sargs = slices.Insert(sargs, i, args...)
324 }
325
326 return sargs
327}
328
329// CancelExecution calls the Cancel() function if set.
330func (sh *Shell) CancelExecution() {

Callers 1

ExecArgsMethod · 0.95

Calls 3

PeekMethod · 0.80
DeleteMethod · 0.65
InsertMethod · 0.45

Tested by

no test coverage detected