MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / ExtractBaseCommand

Function ExtractBaseCommand

tools/bash/tokenizer.go:264–281  ·  view source on GitHub ↗
(command string)

Source from the content-addressed store, hash-verified

262}
263
264func ExtractBaseCommand(command string) string {
265 cleaned := StripAllSafeEnvPrefixes(strings.TrimSpace(command))
266 if cleaned == "" {
267 return ""
268 }
269 tokens := Tokenize(cleaned, false)
270 if len(tokens) == 0 {
271 return ""
272 }
273 base := tokens[0]
274 if base == "sudo" || base == "doas" || base == "pkexec" {
275 if len(tokens) == 1 {
276 return ""
277 }
278 base = tokens[1]
279 }
280 return NormalizeBaseToken(base)
281}

Calls 3

StripAllSafeEnvPrefixesFunction · 0.85
TokenizeFunction · 0.85
NormalizeBaseTokenFunction · 0.85