1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-28 05:00:59 +01:00
zsh/Completion/User/_find
1999-08-23 10:07:17 +00:00

31 lines
887 B
Text

#compdef find
local prev="$words[CURRENT-1]" expl
if compset -N '-(ok|exec)' '\;'; then
_normal
elif [[ "$PREFIX" = -* ]]; then
_description expl option
compadd "$expl[@]" - -daystart -{max,min,}depth -follow -noleaf \
-version -xdev -{a,c,}newer -{a,c,m}{min,time} -empty -false \
-{fs,x,}type -gid -inum -links -{i,}{l,}name -{no,}{user,group} \
-path -perm -regex -size -true -uid -used -exec -{f,}print{f,0,} \
-ok -prune -ls
elif [[ CURRENT -eq 2 ]]; then
local ret=1
_description expl directory
compgen "$expl[@]" -g '. ..' && ret=0
_files -/ && ret=0
return ret
elif [[ "$prev" = -((a|c|)newer|fprint(|0|f)) ]]; then
_files
elif [[ "$prev" = -fstype ]]; then
_description expl 'file system type'
compadd "$expl[@]" ufs 4.2 4.3 nfs tmp mfs S51K S52K
elif [[ "$prev" = -group ]]; then
_groups
elif [[ "$prev" = -user ]]; then
_users
fi