mirror of
https://gitee.com/mirrors/ohmyzsh.git
synced 2026-10-13 23:14:22 +08:00
znt: update to v2.1.15
This commit is contained in:
1 parent
19769fded2
commit
e2d157d589
25 files changed
+1178
-111
No files matched your search
@@ -0,0 +1,41 @@
|
||||
#compdef n-kill
|
||||
|
||||
local context ret=1
|
||||
|
||||
typeset -a list linewords
|
||||
typeset -aU words wordbits
|
||||
local line word
|
||||
integer cygwin=0
|
||||
|
||||
local IFS="
|
||||
"
|
||||
|
||||
case "$(uname)" in
|
||||
CYGWIN*) list=( `command ps -Wa` ); cygwin=1 ;;
|
||||
*) list=( `command ps -o pid,uid,command -A` ) ;;
|
||||
esac
|
||||
|
||||
shift list
|
||||
|
||||
IFS=" "
|
||||
for line in "${list[@]}"; do
|
||||
linewords=( $=line )
|
||||
if [ "$cygwin" = "1" ]; then
|
||||
linewords=( "${(@)linewords[8,-1]}" )
|
||||
else
|
||||
linewords=( "${(@)linewords[3,-1]}" )
|
||||
fi
|
||||
for word in "${linewords[@]}"; do
|
||||
if [ "$cygwin" = "1" ]; then
|
||||
wordbits=( "${(@s:\:)word}" )
|
||||
else
|
||||
wordbits=( "${(@s:/:)word}" )
|
||||
fi
|
||||
words+=( "${wordbits[@]}" )
|
||||
done
|
||||
done
|
||||
|
||||
_wanted bits expl "Processes' name bits" \
|
||||
compadd "$@" -a - words && ret=0
|
||||
|
||||
return "$ret"
|
||||
Reference in new issue
Block a user