[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-241-g0a40e98

Ville Skyttä ville.skytta at iki.fi
Mon May 2 12:23:14 UTC 2011


The following commit has been merged in the master branch:
commit d1d05e2b82c09be09c81f3ce1eb6aecf68fe3551
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Mon May 2 14:04:58 2011 +0300

    pgrep: Add option and option argument completions.

diff --git a/completions/procps b/completions/procps
index 299bd90..32613bd 100644
--- a/completions/procps
+++ b/completions/procps
@@ -27,9 +27,30 @@ _pgrep()
     local cur prev words cword
     _init_completion || return
 
-    _pnames
+    case $prev in
+        -d|-g|-s|-t)
+            return
+            ;;
+        -G)
+            _gids
+            return
+            ;;
+        -P)
+            _pids
+            return
+            ;;
+        -u|-U)
+            _uids
+            return
+            ;;
+    esac
 
-    return 0
+    if [[ $cur == -* ]]; then
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
+        return
+    fi
+
+    _pnames
 }
 have pgrep && complete -F _pgrep pgrep
 

-- 
bash-completion



More information about the Bash-completion-commits mailing list