mirror of
https://github.com/chmln/sd
synced 2024-11-26 04:50:22 +00:00
Merge pull request #148 from hexagonrecursion/patch-1
Doc: nitpick: `--` has no special meaning to shells
This commit is contained in:
commit
3a9759a081
1 changed files with 12 additions and 6 deletions
18
README.md
18
README.md
|
@ -218,13 +218,19 @@ done
|
|||
```
|
||||
|
||||
### Edge cases
|
||||
replace/-with string needs extra `--` before it, if starts with double-minus
|
||||
(this is a limitation of the bash itself)
|
||||
sd will interpret every argument starting with `-` as a (potentially unknown) flag.
|
||||
The common convention of using `--` to signal the end of flags is respected:
|
||||
|
||||
```bash
|
||||
echo "test/test" | sd '/' -- '--inteneded--'
|
||||
test--inteneded--test
|
||||
$ echo "./hello foo" | sd "foo" "-w"
|
||||
error: Found argument '-w' which wasn't expected, or isn't valid in this context
|
||||
|
||||
echo "start/--/end" | sd --string-mode -- '--' 'middle'
|
||||
start/middle/end
|
||||
USAGE:
|
||||
sd [OPTIONS] <find> <replace-with> [files]...
|
||||
|
||||
For more information try --help
|
||||
$ echo "./hello foo" | sd "foo" -- "-w"
|
||||
./hello -w
|
||||
$ echo "./hello --foo" | sd -- "--foo" "-w"
|
||||
./hello -w
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue