--- /etc/bash_completion.d/findutils.orig.bak 2010-04-24 23:24:29.868594584 +0200 +++ /etc/bash_completion.d/findutils 2010-04-25 00:31:18.446187740 +0200 @@ -16,7 +16,7 @@ _find() COMPREPLY=( $( compgen -W '0 1 2 3 4 5 6 7 8 9' -- "$cur" ) ) return 0 ;; - -?(a|c)newer|-fls|-fprint?(0|f)|-?(i)?(l)name|-?(i)wholename) + -?(a|c)newer|-fls|-fprint?(0|f)|-?(i)?(l)name|-?(i)wholename|-samefile) _filedir return 0 ;; @@ -49,7 +49,7 @@ _find() COMPREPLY=( $( compgen -u -- "$cur" ) ) return 0 ;; - -exec|-ok) + -exec?(dir)|-ok?(dir)) COMP_WORDS=(COMP_WORDS[0] "$cur") COMP_CWORD=1 _command @@ -60,6 +60,11 @@ _find() # do nothing, just wait for a parameter to be given return 0 ;; + -regextype) + COMPREPLY=( $( compgen -W 'emacs posix-awk posix-basic posix-egrep \ + posix-extended' -- "$cur" ) ) + return 0 + ;; esac _expand || return 0 @@ -76,22 +81,24 @@ _find() fi # complete using basic options - COMPREPLY=( $( compgen -W '-daystart -depth -follow -help -maxdepth \ - -mindepth -mount -noleaf -version -xdev -amin -anewer \ - -atime -cmin -cnewer -ctime -empty -false -fstype \ - -gid -group -ilname -iname -inum -ipath -iregex \ - -wholename \ - -links -lname -mmin -mtime -name -newer -nouser \ - -nogroup -perm -regex -size -true -type -uid -used \ - -user -xtype -exec -fls -fprint -fprint0 -fprintf -ok \ - -print -print0 -printf -prune -ls -wholename -iwholename' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '-daystart -depth -follow -help \ + -ignore_readdir_race -maxdepth -mindepth -mount \ + -noignore_readdir_race -noleaf -regextype -version -warn -nowarn -xdev \ + -amin -anewer -atime -cmin -cnewer -ctime -empty -executable -false \ + -fstype -gid -group -ilname -iname -inum -ipath -iregex \ + -iwholename -links -lname -mmin -mtime -name -newer -nogroup -nouser \ + -path -perm -readable -regex -samefile -size -true -type -uid -used \ + -user -wholename -writable -xtype \ + -delete -exec -execdir -fls -fprint -fprint0 -fprintf -ls -ok -okdir \ + -print -print0 -printf -prune -quit' -- "$cur" ) ) # this removes any options from the list of completions that have # already been specified somewhere on the command line, as long as # these options can only be used once (in a word, "options", in # opposition to "tests" and "actions", as in the find(1) manpage). - onlyonce=' -daystart -depth -follow -help -maxdepth -mindepth -mount \ - -noleaf -version -xdev ' + onlyonce=' -daystart -depth -follow -help -ignore_readdir_race -maxdepth \ + -mindepth -mount -noignore_readdir_race -noleaf -regextype -version \ + -warn -nowarn -xdev ' COMPREPLY=( $( echo "${COMP_WORDS[@]}" | \ (while read -d ' ' i; do [ "$i" == "" ] ||