mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-04-17 09:34:33 +00:00
refactor(alias-finder): Simplify --longer option activation
This commit is contained in:
parent
d860c7548f
commit
3a746a7ee1
|
@ -24,9 +24,7 @@ alias-finder() {
|
||||||
## - add escaping character to special characters
|
## - add escaping character to special characters
|
||||||
cmd=$(echo -n "$cmd" | tr '\n' ' ' | xargs | tr -s '[:space:]' | sed 's/[].\|$(){}?+*^[]/\\&/g')
|
cmd=$(echo -n "$cmd" | tr '\n' ' ' | xargs | tr -s '[:space:]' | sed 's/[].\|$(){}?+*^[]/\\&/g')
|
||||||
|
|
||||||
if [[ $longer == true ]]; then
|
$longer && wordEnd=".*$"
|
||||||
wordEnd="" # remove wordEnd to find longer aliases
|
|
||||||
fi
|
|
||||||
|
|
||||||
# find with alias and grep, removing last word each time until no more words
|
# find with alias and grep, removing last word each time until no more words
|
||||||
while [[ $cmd != "" ]]; do
|
while [[ $cmd != "" ]]; do
|
||||||
|
|
Loading…
Reference in New Issue
Block a user