X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/389698e53a4d3130035e46bf7f8b28480ae9ed8a..6dc0bafd5915b01a341cc0efbc744abd73163872:/lisp/pcmpl-gnu.el diff --git a/lisp/pcmpl-gnu.el b/lisp/pcmpl-gnu.el index ada2a04176..e4e8f3a2c5 100644 --- a/lisp/pcmpl-gnu.el +++ b/lisp/pcmpl-gnu.el @@ -1,6 +1,6 @@ ;;; pcmpl-gnu.el --- completions for GNU project tools -*- lexical-binding: t -*- -;; Copyright (C) 1999-2015 Free Software Foundation, Inc. +;; Copyright (C) 1999-2016 Free Software Foundation, Inc. ;; Package: pcomplete @@ -328,6 +328,42 @@ (pcomplete-entries)) nil 'identity)))) +;;;###autoload + +(defun pcomplete/find () + "Completion for the GNU find utility." + (let ((prec (pcomplete-arg 'last -1))) + (cond ((and (pcomplete-match "^-" 'last) + (string= "find" prec)) + (pcomplete-opt "HLPDO")) + ((pcomplete-match "^-" 'last) + (while (pcomplete-here + '("-amin" "-anewer" "-atime" "-cmin" "-cnewer" "-context" + "-ctime" "-daystart" "-delete" "-depth" "-empty" "-exec" + "-execdir" "-executable" "-false" "-fls" "-follow" + "-fprint" "-fprint0" "-fprintf" "-fstype" "-gid" "-group" + "-help" "-ignore_readdir_race" "-ilname" "-iname" + "-inum" "-ipath" "-iregex" "-iwholename" + "-links" "-lname" "-ls" "-maxdepth" + "-mindepth" "-mmin" "-mount" "-mtime" + "-name" "-newer" "-nogroup" "-noignore_readdir_race" + "-noleaf" "-nouser" "-nowarn" "-ok" + "-okdir" "-path" "-perm" "-print" + "-print0" "-printf" "-prune" "-quit" + "-readable" "-regex" "-regextype" "-samefile" + "-size" "-true" "-type" "-uid" + "-used" "-user" "-version" "-warn" + "-wholename" "-writable" "-xdev" "-xtype")))) + ((string= "-type" prec) + (while (pcomplete-here (list "b" "c" "d" "p" "f" "l" "s" "D")))) + ((string= "-xtype" prec) + (while (pcomplete-here (list "b" "c" "d" "p" "f" "l" "s")))) + ((or (string= prec "-exec") + (string= prec "-execdir")) + (while (pcomplete-here* (funcall pcomplete-command-completion-function) + (pcomplete-arg 'last) t)))) + (while (pcomplete-here (pcomplete-dirs) nil 'identity)))) + ;;;###autoload (defalias 'pcomplete/gdb 'pcomplete/xargs)