Merge pull request #91 from dym-sh/patch-1

edge-case info for strings starting with '--'
This commit is contained in:
Gregory 2020-07-20 16:59:23 -04:00 committed by GitHub
commit 03dcd40591
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -210,3 +210,15 @@ for file in $(fd --type file); do
sd 'from "react"' 'from "preact"' "$file";
done
```
### Edge cases
replace/-with string needs extra `--` before it, if starts with double-minus
(this is a limitation of the bash itself)
```bash
echo "test/test" | sd '/' -- '--inteneded--'
test--inteneded--test
echo "start/--/end" | sd --string-mode -- '--' 'middle'
start/middle/end
```