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

Function ParseBase

tools/bash/semantics.go:129–146  ·  view source on GitHub ↗
(command string)

Source from the content-addressed store, hash-verified

127}
128
129func ParseBase(command string) (string, string) {
130 tokens := strings.Fields(strings.TrimSpace(command))
131 if len(tokens) == 0 {
132 return "", ""
133 }
134
135 base := tokens[0]
136 if idx := strings.LastIndex(base, "/"); idx >= 0 {
137 base = base[idx+1:]
138 }
139
140 sub := ""
141 if len(tokens) > 1 && !strings.HasPrefix(tokens[1], "-") {
142 sub = tokens[1]
143 }
144
145 return base, sub
146}
147func IsSearchOrReadBashCommand(commandLine string) bool {
148 segments := SplitPipeline(commandLine)
149 meaningfulSegments := 0

Callers 2

ClassifyBashCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected