MCPcopy Index your code
hub / github.com/coder/coder / cmdBase

Function cmdBase

coderd/util/shellparse/shellparse.go:84–89  ·  view source on GitHub ↗

cmdBase returns the base name of a command path, handling both forward and back slashes since commands may originate from Windows workspaces while this code runs on a Linux server.

(prog string)

Source from the content-addressed store, hash-verified

82// forward and back slashes since commands may originate from Windows
83// workspaces while this code runs on a Linux server.
84func cmdBase(prog string) string {
85 if i := strings.LastIndexAny(prog, `/\`); i >= 0 {
86 return prog[i+1:]
87 }
88 return prog
89}
90
91// firstNonFlagLiteral returns the literal value of the first word in
92// ws that does not start with "-", or "" if none qualifies.

Callers 1

ParseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected