fix(alias-finder): Add missing closing single quote for cheaper option

This commit is contained in:
Roeniss Moon 2025-03-23 23:47:32 +09:00
parent 3a746a7ee1
commit 1297908265
No known key found for this signature in database
GPG Key ID: 9E9AE088DBD537FB

View File

@ -33,7 +33,7 @@ alias-finder() {
# make filter to find only shorter results than current cmd
if [[ $cheaper == true ]]; then
cmdLen=$(echo -n "$cmd" | wc -c)
filter="^'{0,1}.{0,$((cmdLen - 1))}="
filter="^'?.{1,$((cmdLen - 1))}'?=" # some aliases is surrounded by single quotes
fi
alias | grep -E "$filter" | grep -E "=$finder"