Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: killall completion
- X-seq: zsh-users 14635
- From: sergio <mailbox@xxxxxxxxxxxxx>
- To: Zsh list <zsh-users@xxxxxxx>
- Subject: Re: killall completion
- Date: Fri, 04 Dec 2009 07:08:20 +0300
- In-reply-to: <091203081540.ZM12147@xxxxxxxxxxxxxxxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <4B14AAA3.3090609@xxxxxxxxxxxxx> <20091201194117.3dc2993b@pws-pc> <4B15BE9F.7020808@xxxxxxxxxxxxx> <091201202341.ZM9955@xxxxxxxxxxxxxxxxxxxxxx> <4B173208.5060602@xxxxxxxxxxxxx> <091203081540.ZM12147@xxxxxxxxxxxxxxxxxxxxxx>
Bart Schaefer wrote:
It offers both signals and process names when completing after "killall"
with nothing else on the line yet.
But it's unnecessary. -SIGNAL ( and also -SIGSIGNAL and -number ) should
be processed as -s SIGNAL.
And this code doesn't offers both signals and process...
#compdef killall
local curcontext="$curcontext" line state ret=1
local all
all=$( (( ${funcstack[(eI)$_comps[sudo]]} || ${(%):-%(!.1.0)} )) && echo
-n a )
_processes_names()
{
compadd "$expl[@]" ${${(f)"$(_call_program processes-names ps
${all}xho comm 2> /dev/null)"}:#ps}
}
_sig_or_proc()
{
_alternative -C set1 \
"signals:signals:_signals -p -s" \
"processes-names:processes-names:_processes_names"
}
_arguments -C\
- set1 \
': :_sig_or_proc' \
'*:processes-names:_processes_names' \
':signals:_signals -p -s' && ret=0
return ret
--
sergio.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author