mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-26 18:01:03 +02:00
48891: Fix pgrep/pkill -f completion
Old completion produced false positives & took too much screen space.
This commit is contained in:
parent
e732073415
commit
891d361572
2 changed files with 12 additions and 2 deletions
|
@ -1,5 +1,8 @@
|
||||||
2021-05-21 Oliver Kiddle <opk@zsh.org>
|
2021-05-21 Oliver Kiddle <opk@zsh.org>
|
||||||
|
|
||||||
|
* Marlon Richert: 48891: Completion/Unix/Command/_pgrep:
|
||||||
|
Fix pgrep/pkill -f completion
|
||||||
|
|
||||||
* Marlon Richert: 48864: Completion/Zsh/Type/_parameters: Improve
|
* Marlon Richert: 48864: Completion/Zsh/Type/_parameters: Improve
|
||||||
extra-verbose completion display strings for array parameter values
|
extra-verbose completion display strings for array parameter values
|
||||||
|
|
||||||
|
|
|
@ -166,8 +166,15 @@ case $state in
|
||||||
ispat=""
|
ispat=""
|
||||||
fi
|
fi
|
||||||
if (( ${+opt_args[-f]} )); then
|
if (( ${+opt_args[-f]} )); then
|
||||||
_wanted process-args expl $ispat'process command line' \
|
local -a matches=( ${(f)"$(
|
||||||
compadd ${${(f)"$(_call_program process-args ps -A -o args=)"}% *}
|
_call_program process-args pgrep -lf ${${:-$PREFIX$SUFFIX}:-.\*}
|
||||||
|
)"} )
|
||||||
|
local -a displ=( "${${matches[@]//':'/'\:'}[@]/ /:}" )
|
||||||
|
matches=( "${matches[@]##<-> }" )
|
||||||
|
|
||||||
|
local desc=$ispat'process command line'
|
||||||
|
_description process-args expl "$desc"
|
||||||
|
_describe -t process-args "$desc" displ matches "$@" -U "$expl[@]"
|
||||||
else
|
else
|
||||||
_wanted processes-names expl $ispat'process name' _process_names -a -t
|
_wanted processes-names expl $ispat'process name' _process_names -a -t
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue