]> git.eshelyaron.com Git - emacs.git/commitdiff
Enhance pcomplete support for xargs
authorKarthik Chikmagalur <karthikchikmagalur@gmail.com>
Sat, 17 Jul 2021 14:29:11 +0000 (16:29 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sat, 17 Jul 2021 14:29:11 +0000 (16:29 +0200)
* lisp/pcmpl-unix.el (pcomplete/xargs): Add support for completing xargs
options, including the ability to distinguish them from the command
xargs runs (bug#49603).
Copyright-paperwork-exempt: yes

lisp/pcmpl-unix.el

index c1aaf829dcf611ed22299d5dbca75ecd21fd8e57..e1d104f74fff37a15d0f045c3f3a6467cbf02e9f 100644 (file)
@@ -82,7 +82,8 @@ being via `pcmpl-ssh-known-hosts-file'."
 ;;;###autoload
 (defun pcomplete/xargs ()
   "Completion for `xargs'."
-  ;; FIXME: Add completion of xargs-specific arguments.
+  (while (string-prefix-p "-" (pcomplete-arg 0))
+    (pcomplete-here (funcall pcomplete-default-completion-function)))
   (funcall pcomplete-command-completion-function)
   (funcall (or (pcomplete-find-completion-function (pcomplete-arg 1))
               pcomplete-default-completion-function)))