You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,7 +125,7 @@ Flag | Effect
125
125
`-m` | **`--output-match`** Output each match on a new line. Will not replace any content but you still need to provide a dummy value (like `_`) as replacement parameter. If search pattern does not contain matching groups the full match will be outputted. If search pattern does contain matching groups only matching groups will be outputted (same line with no delimiter). [boolean]
126
126
`-T` | **`--trim-pipe`** Trim piped data before processing. If piped data only consists of chars that can be trimmed (new line, space, tabs...) it will become an empty string. [boolean]
127
127
`-R` | **`--replacement-pipe`** Replacement will be piped in. You still need to provide a dummy value (like `_`) as replacement parameter. [boolean]
128
-
`-j` | **`--replacement-js`** Treat replacement as javascript source code. The statement from the last expression will become the replacement string. Purposefully implemented the most insecure way possible to remove _any_ incentive to consider running code from an untrusted person - that be anyone that is not yourself. The full match will be available as a javascript variable named $0 while each captured group will be available as $1, $2, $3, ... and so on. At some point, the $ char _will_ give you a headache when used from the command line, so use €0, €1, €2 €3 ... instead. If the javascript source code references to the full match or a captured group the code will run once per match. Otherwise, it will run once per file. The code has access to the following variables: `_fs` from node, `_globs` from npm, `_cwd` current working dir, `_pipe` is the piped data into the command (null if no piped data), `_find` is the final pattern searched for. `_text` is the full text being searched (= file contents or piped data). The following values are also available if working on a file (if data is being piped they are all set to an empty string): `_file` is the full path of the active file being searched (including full filename), `_path` is the full path without filename of the active file being searched, `_filename` is the full filename of the active file being searched, `_name` is the filename of the active file being searched with no extension, `_ext` is the extension of the filename including leading dot. [boolean]
128
+
`-j` | **`--replacement-js`** Treat replacement as javascript source code. The statement from the last expression will become the replacement string. Purposefully implemented the most insecure way possible to remove _any_ incentive to consider running code from an untrusted person - that be anyone that is not yourself. The full match will be available as a javascript variable named $0 while each captured group will be available as $1, $2, $3, ... and so on. At some point, the $ char _will_ give you a headache when used from the command line, so use €0, €1, €2 €3 ... instead. If the javascript source code references to the full match or a captured group the code will run once per match. Otherwise, it will run once per file. The code has access to the following variables: `require` from node, `fs` from node, `globs` from npm, `_cwd` current working dir, `_pipe` is the data piped into the command (null if no piped data), `_find` is the pattern searched for (the needle). `_text` is the full text being searched i.e. file content or piped data (the haystack). The following values are also available if working on a file (if data is being piped they are all set to an empty string): `_file` is the full path of the active file being searched (including full filename), `_path` is the full path without filename of the active file being searched, `_filename` is the full filename of the active file being searched, `_name` is the filename of the active file being searched with no extension, `_ext` is the extension of the filename including leading dot. [boolean]
`At some point, the $ char _will_ give you a headache when used from the command line, so use €0, €1, €2 €3 ... instead. `+
100
100
`If the javascript source code references to the full match or a captured group the code will run once per match. Otherwise, it will run once per file. `+
101
101
`\nThe code has access to the following variables: `+
102
-
`\n'_fs' from node, `+
103
-
`\n'_globs' from npm, `+
102
+
`\n'require' from node, `+
103
+
`\n'fs' from node, `+
104
+
`\n'globs' from npm, `+
104
105
`\n'_cwd' current working dir, `+
105
106
`\n'_pipe' is the data piped into the command (null if no piped data), `+
106
-
`\n'_find' is the final pattern searched for. `+
107
-
`\n'_text' is the full text being searched (= file contents or piped data). `+
107
+
`\n'_find' is the pattern searched for (the needle). `+
108
+
`\n'_text' is the full text being searched i.e. file content or piped data (the haystack). `+
108
109
`\nThe following values are also available if working on a file (if data is being piped they are all set to an empty string): `+
109
110
`\n'_file' is the full path of the active file being searched (including full filename), `+
110
111
`\n'_path' is the full path without filename of the active file being searched, `+
0 commit comments