refactor(alias-finder): Simplify --longer option activation

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

View File

@ -39,10 +39,7 @@ alias-finder() {
alias | grep -E "$filter" | grep -E "=$finder"
$exact && break # because exact case is only one
if [[ $longer = true ]]; then
break # because above grep command already found every longer aliases during first cycle
fi
$longer && break # because above grep command already found every longer aliases during first cycle
cmd=$(sed -E 's/ {0,}[^ ]*$//' <<< "$cmd") # remove last word
done