pgrep: Add option and option argument completions.
This commit is contained in:
parent
dd59b49f25
commit
d1d05e2b82
@ -27,9 +27,30 @@ _pgrep()
|
|||||||
local cur prev words cword
|
local cur prev words cword
|
||||||
_init_completion || return
|
_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
|
have pgrep && complete -F _pgrep pgrep
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user