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

Function NormalizeBaseToken

tools/bash/tokenizer.go:241–262  ·  view source on GitHub ↗
(token string)

Source from the content-addressed store, hash-verified

239}
240
241func NormalizeBaseToken(token string) string {
242 if strings.Contains(token, "=") {
243 return token
244 }
245
246 if idx := strings.LastIndex(token, "/"); idx >= 0 {
247 token = token[idx+1:]
248 }
249
250 if idx := strings.LastIndex(token, `\`); idx >= 0 {
251 token = token[idx+1:]
252 }
253
254 if idx := strings.LastIndex(token, "."); idx >= 0 {
255 namePart := token[:idx]
256 if namePart != "" {
257 token = namePart
258 }
259 }
260
261 return token
262}
263
264func ExtractBaseCommand(command string) string {
265 cleaned := StripAllSafeEnvPrefixes(strings.TrimSpace(command))

Callers 2

ExtractBaseCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected