From 35b2633ad941966f5fca07b625a594a5b68c0fdb Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Mon, 15 Nov 1999 12:01:46 +0000 Subject: manual/8639 --- Completion/Builtins/_pids | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'Completion/Builtins/_pids') diff --git a/Completion/Builtins/_pids b/Completion/Builtins/_pids index f96c11e2d..597a19477 100644 --- a/Completion/Builtins/_pids +++ b/Completion/Builtins/_pids @@ -3,23 +3,25 @@ # If given the `-m ' option, this tries to complete only pids # of processes whose command line match the `'. -local list expl match desc +local list expl match desc listargs args -_tags any processes || return 1 +_wanted processes expl 'process ID' || return 1 if [[ "$1" = -m ]]; then match="${2}*" shift 2 fi -_description expl 'process ID' +_style -a ps list-arguments listargs +_style -a ps arguments args +(( $#listargs )) || listargs=( "$args[@]" ) -if _style processes description yes; then - list=("${(@Mr:COLUMNS-1:)${(f@)$(ps ${=compconfig[ps_listargs]:-$=compconfig[ps_args]} 2>/dev/null)}[2,-1]:#[ ]#${PREFIX}[0-9]#${SUFFIX}[ ]*${~match}}") +if _style processes description; then + list=("${(@Mr:COLUMNS-1:)${(f@)$(ps $listargs 2>/dev/null)}[2,-1]:#[ ]#${PREFIX}[0-9]#${SUFFIX}[ ]*${~match}}") desc=(-ld list) else desc=() fi compadd "$expl[@]" "$@" "$desc[@]" - \ - ${${${(M)${(f)"$(ps $=compconfig[ps_args] 2>/dev/null)"}[2,-1]:#*${~match}}## #}%% *} + ${${${(M)${(f)"$(ps $args 2>/dev/null)"}[2,-1]:#*${~match}}## #}%% *} -- cgit 1.4.1