Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] killall completion for FreeBSD

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.


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


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} }'
   _signals -p

Messages sorted by: Reverse Date, Date, Thread, Author