From c6603669a2667a4905aa4831f40e276b2c3bd4a4 Mon Sep 17 00:00:00 2001 From: dana Date: Mon, 14 Jun 2021 22:19:38 -0500 Subject: 48920: _pgrep: Address issues related to -f completion --- Completion/Unix/Command/_pgrep | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Completion') diff --git a/Completion/Unix/Command/_pgrep b/Completion/Unix/Command/_pgrep index 443acf3c8..38b1aebd8 100644 --- a/Completion/Unix/Command/_pgrep +++ b/Completion/Unix/Command/_pgrep @@ -170,10 +170,13 @@ case $state in ispat+="full " fi if (( ${+opt_args[-f]} )); then + local -a opts=( -lf ) + [[ $OSTYPE == linux* ]] && opts=( -a ) local -a matches=( ${(f)"$( - _call_program process-args pgrep -lf ${${:-$PREFIX$SUFFIX}:-.\*} + _call_program process-args pgrep ${(@q)opts} -- \ + ${(q)${${:-$PREFIX$SUFFIX}:-.\*}} )"} ) - local -a displ=( "${${matches[@]//':'/'\:'}[@]/ /:}" ) + local -a displ=( "${${matches[@]//:/\:}[@]/ /:}" ) matches=( "${matches[@]##<-> }" ) local desc=$ispat'process command line' -- cgit 1.4.1