zsh:suffix(): Use zshisms to find --'s index

This commit is contained in:
2023-02-27 14:13:54 +01:00
parent 112b195d7b
commit 4640dec63d

View File

@@ -526,11 +526,7 @@ suffix() {
return 1
fi
local i=1
for arg; do
[[ $arg != "--" ]] || break
: "$((i++))"
done
local i=${@[(ei)--]}
# NOTE: if "--" is not included in $@, i will be greater than $#, and no
# starting point is passed to `find`, which then defaults to `.`.