zsh:suffix(): Use bfs if installed
This commit is contained in:
@@ -521,8 +521,13 @@ shellcheck() {
|
|||||||
# `sfx` is given to `find` in the form `-name "*$sfx"`.
|
# `sfx` is given to `find` in the form `-name "*$sfx"`.
|
||||||
# `path` is given as starting point to `find`, defaulting to `.`.
|
# `path` is given as starting point to `find`, defaulting to `.`.
|
||||||
suffix() {
|
suffix() {
|
||||||
if (( ! $+commands[find] )); then
|
local cmd
|
||||||
printf >&2 "find not installed\n"
|
if (( $+commands[bfs] )); then
|
||||||
|
cmd=bfs
|
||||||
|
elif (( $+commands[find] )); then
|
||||||
|
cmd=find
|
||||||
|
else
|
||||||
|
printf >&2 "Neither bfs nor find installed\n"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -538,7 +543,7 @@ suffix() {
|
|||||||
# Join with " -o -name " and then split again using shell parsing
|
# Join with " -o -name " and then split again using shell parsing
|
||||||
names=( "${(@zj: -o -name :)names}" )
|
names=( "${(@zj: -o -name :)names}" )
|
||||||
# Pass starting points and the name arguments
|
# Pass starting points and the name arguments
|
||||||
find "${@:$((i+1))}" -name "${(@)names}"
|
"$cmd" "${@:$((i+1))}" -name "${(@)names}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Find duplicate files
|
# Find duplicate files
|
||||||
|
|||||||
Reference in New Issue
Block a user