(
{
pattern,
path,
glob,
type,
output_mode = 'files_with_matches',
'-B': context_before,
'-A': context_after,
'-C': context_c,
context,
'-n': show_line_numbers = true,
'-i': case_insensitive = false,
head_limit,
offset = 0,
multiline = false,
},
{ abortController, getAppState },
)
| 308 | } |
| 309 | }, |
| 310 | async call( |
| 311 | { |
| 312 | pattern, |
| 313 | path, |
| 314 | glob, |
| 315 | type, |
| 316 | output_mode = 'files_with_matches', |
| 317 | '-B': context_before, |
| 318 | '-A': context_after, |
| 319 | '-C': context_c, |
| 320 | context, |
| 321 | '-n': show_line_numbers = true, |
| 322 | '-i': case_insensitive = false, |
| 323 | head_limit, |
| 324 | offset = 0, |
| 325 | multiline = false, |
| 326 | }, |
| 327 | { abortController, getAppState }, |
| 328 | ) { |
| 329 | const absolutePath = path ? expandPath(path) : getCwd() |
| 330 | const args = ['--hidden'] |
| 331 | |
| 332 | // Exclude VCS directories to avoid noise from version control metadata |
| 333 | for (const dir of VCS_DIRECTORIES_TO_EXCLUDE) { |
| 334 | args.push('--glob', `!${dir}`) |
| 335 | } |
| 336 | |
| 337 | // Limit line length to prevent base64/minified content from cluttering output |
| 338 | args.push('--max-columns', '500') |
| 339 | |
| 340 | // Only apply multiline flags when explicitly requested |
| 341 | if (multiline) { |
| 342 | args.push('-U', '--multiline-dotall') |
| 343 | } |
| 344 | |
| 345 | // Add optional flags |
| 346 | if (case_insensitive) { |
| 347 | args.push('-i') |
| 348 | } |
| 349 | |
| 350 | // Add output mode flags |
| 351 | if (output_mode === 'files_with_matches') { |
| 352 | args.push('-l') |
| 353 | } else if (output_mode === 'count') { |
| 354 | args.push('-c') |
| 355 | } |
| 356 | |
| 357 | // Add line numbers if requested |
| 358 | if (show_line_numbers && output_mode === 'content') { |
| 359 | args.push('-n') |
| 360 | } |
| 361 | |
| 362 | // Add context flags (-C/context takes precedence over context_before/context_after) |
| 363 | if (output_mode === 'content') { |
| 364 | if (context !== undefined) { |
| 365 | args.push('-C', context.toString()) |
| 366 | } else if (context_c !== undefined) { |
| 367 | args.push('-C', context_c.toString()) |
nothing calls this directly
no test coverage detected