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

Function extractGrepPaths

tools/bash/validation.go:192–228  ·  view source on GitHub ↗
(tokens []string)

Source from the content-addressed store, hash-verified

190}
191
192func extractGrepPaths(tokens []string) []string {
193 paths := []string{}
194 patternFound := false
195 skipNext := false
196
197 for _, t := range tokens {
198 if skipNext {
199 skipNext = false
200 continue
201 }
202
203 if t == "--" {
204 continue
205 }
206
207 if t == "-e" || t == "-f" || t == "--regexp" || t == "--file" {
208 if !patternFound {
209 patternFound = true
210 }
211 skipNext = true
212 continue
213 }
214
215 if strings.HasPrefix(t, "-") {
216 continue
217 }
218
219 if !patternFound {
220 patternFound = true
221 continue
222 }
223
224 paths = append(paths, t)
225 }
226
227 return paths
228}
229
230func extractChownPaths(tokens []string) []string {
231 ownerFound := false

Callers 1

ExtractPathsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected