diff --git a/pkg/cli/functions.go b/pkg/cli/functions.go index 14371cf..d193262 100644 --- a/pkg/cli/functions.go +++ b/pkg/cli/functions.go @@ -168,7 +168,7 @@ To replace or remove a single line, *set start_line and end_line to the same val Examples: * Insert the lines "helloworld" at line 10, preserving other content: - {"path": "myfile", "operation": "insert", "start_line": 10, "content": "hello\nworld"} + {"path": "myfile", "operation": "insert_before", "start_line": 10, "content": "hello\nworld"} * Remove lines 45 up to and including 54: {"path": "myfile", "operation": "remove", "start_line": 45, "end_line": 54} @@ -187,7 +187,7 @@ Examples: }, "operation": { Type: "string", - Description: `The the type of modification to make to the file. One of: insert, remove, replace`, + Description: `The the type of modification to make to the file. One of: insert_before, remove, replace`, }, "start_line": { Type: "integer", @@ -478,7 +478,7 @@ func ModifyFile(path string, operation string, content string, startLine int, en contentLines := strings.Split(strings.Trim(content, "\n"), "\n") switch operation { - case "insert": + case "insert_before": // Insert new lines before := lines[:startLine-1] after := append(contentLines, lines[startLine-1:]...)