Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] killall completion for FreeBSD
- X-seq: zsh-workers 20180
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Jean-Baptiste Quenot <jb.quenot@xxxxxxxxxxx>
- Subject: Re: [PATCH] killall completion for FreeBSD
- Date: Fri, 23 Jul 2004 16:08:34 +0200
- Cc: zsh-workers@xxxxxxxxxx
- In-reply-to: <20040721211529.GA2406@xxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20040721211529.GA2406@xxxxxxxxxxxxxxxxxxxxxx>
Jean-Baptiste Quenot wrote:
> I noticed that killall completion does not work on FreeBSD. This patch
> addresses the issue, as the completion was originally only intended for
> GNU/Linux. Indeed, FreeBSD uses a slightly different syntax for
> expressing ps output options.
Thanks.
That doesn't seem to work on the sourceforge FreeBSD 4.8 machine. As
you say, it comes down to the syntax for ps output options. `ps ho cmd'
seems to be Linux only. `ps ho comm' is more suitable because it
doesn't print arguments but it doesn't seem to work everywhere. `ps ho
command' seems to work on all the BSDs I tried. So I'll try this patch
instead.
Oliver
Index: Completion/Unix/Command/_killall
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_killall,v
retrieving revision 1.2
diff -u -r1.2 _killall
--- Completion/Unix/Command/_killall 19 Aug 2002 15:00:10 -0000 1.2
+++ Completion/Unix/Command/_killall 23 Jul 2004 13:51:37 -0000
@@ -1,9 +1,9 @@
#compdef killall killall5
-if [[ $service = killall && "$OSTYPE" = linux* ]]; then
+if [[ $service = killall && "$OSTYPE" = (linux*|*bsd*|darwin*) ]]; then
_alternative \
- 'signals:: _signals -p' \
- 'processes:process:{ compadd "$expl[@]" ${${${${(f)"$(_call_program processes-names ps ${${EUID/(#s)0(#e)/xa}//[0-9]#/} ho cmd 2> /dev/null)"//[][\(\)]/}:#(ps|COMMAND|-*)}%%\ *}:t} }'
+ 'signals:: _signals -p' \
+ 'processes-names:process:{ compadd "$expl[@]" ${${${${(f)"$(_call_program processes-names ps ${${EUID/(#s)0(#e)/xa}//[0-9]#/}ho command 2> /dev/null)"//[][\(\)]/}:#(ps|COMMAND|-*)}%%\ *}:t} }'
else
_signals -p
fi
Messages sorted by:
Reverse Date,
Date,
Thread,
Author