refactor(alias-finder): Add meaningful variable name for finder variable part

This commit is contained in:
Roeniss Moon 2025-03-24 00:00:12 +09:00
commit 92fb85e498
No known key found for this signature in database
GPG key ID: 9E9AE088DBD537FB

View file

@ -1,5 +1,5 @@
alias-finder() { alias-finder() {
local cmd=" " exact=false longer=false cheaper=false wordEnd="'?$" finder="" filter="" local cmd=" " exact=false longer=false cheaper=false wordStart="^'?" wordEnd="'?$" finder="" filter=""
# setup options # setup options
# XXX: This logic has flaw. If user enable options with zstyle, there's no way to disable it. # XXX: This logic has flaw. If user enable options with zstyle, there's no way to disable it.
@ -28,7 +28,7 @@ alias-finder() {
# 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
finder="'{0,1}$cmd$wordEnd" finder="$wordStart$cmd$wordEnd"
# make filter to find only shorter results than current cmd # make filter to find only shorter results than current cmd
if [[ $cheaper == true ]]; then if [[ $cheaper == true ]]; then