mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-24 19:24:22 +01:00
fix: grep failing when pattern started with a dash
This commit is contained in:
@@ -367,6 +367,7 @@ export namespace Ripgrep {
|
||||
args.push(`--max-count=${input.limit}`)
|
||||
}
|
||||
|
||||
args.push("--")
|
||||
args.push(input.pattern)
|
||||
|
||||
const command = args.join(" ")
|
||||
|
||||
@@ -20,7 +20,7 @@ export const GrepTool = Tool.define("grep", {
|
||||
const searchPath = params.path || Instance.directory
|
||||
|
||||
const rgPath = await Ripgrep.filepath()
|
||||
const args = ["-nH", "--field-match-separator=|", params.pattern]
|
||||
const args = ["-nH", "--field-match-separator=|", "--regexp", params.pattern]
|
||||
if (params.include) {
|
||||
args.push("--glob", params.include)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user