mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-02 02:19:06 +01:00
Fixed Perl find/substitute options, added inverse.
This commit is contained in:
parent
f77e2c8e05
commit
e1a71a84b1
3 changed files with 12 additions and 8 deletions
|
|
@ -15,13 +15,13 @@ options:
|
|||
EOF
|
||||
)"
|
||||
|
||||
while getopts ':igmxe::' opt; do
|
||||
while getopts ':gimsx' opt; do
|
||||
case "$opt" in
|
||||
(i) modifiers="${modifiers}i" ;;
|
||||
(g) modifiers="${modifiers}g" ;;
|
||||
(i) modifiers="${modifiers}i" ;;
|
||||
(m) modifiers="${modifiers}m" ;;
|
||||
(s) modifiers="${sodifiers}s" ;;
|
||||
(x) modifiers="${modifiers}x" ;;
|
||||
(e) modifiers="${modifiers}e" ;;
|
||||
(:)
|
||||
print "$0: option requires an argument: $OPTARG" >&2
|
||||
print "$usage" >&2
|
||||
|
|
@ -46,3 +46,4 @@ replacement="$2"
|
|||
repeat 2 shift
|
||||
|
||||
perl -i'.orig' -n -l -e "s/${pattern//\//\\/}/${replacement//\//\\/}/${modifiers}; print" "$@"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue