zsh-workers
 help / color / mirror / code / Atom feed
* Re: Suggestion for _killall
@ 1999-11-19  9:21 Sven Wischnowsky
  1999-11-20 14:58 ` PATCH: _mount upgrade Alexandre Duret-Lutz
  0 siblings, 1 reply; 2+ messages in thread
From: Sven Wischnowsky @ 1999-11-19  9:21 UTC (permalink / raw)
  To: zsh-workers


Alexandre Duret-Lutz wrote:

> >>> "FH" == Falk Hueffner <falk.hueffner@student.uni-tuebingen.de> writes:
> 
> [...]
> 
>  FH> Unfortunately, ps behaves different on each platform, so I don't know
>  FH> if this is really portable.
> 
> It isn't. Perhaps it could be done the same way as _kill?
> One other issue is that killall also behaves differently :
> 
> - On Debian (and probably most Linux distribution) it kill
>   process by names;
> 
> - On Solaris, Digital Unix, RISC/os and maybe others, it kills
>   *all* actives process and thus completing with process name is
>   inappropriate.

Uh, oh...

> Maybe there could be two _killall in Zsh ?  Let's say one in
> Completion/User/_killall and one in Completion/Linux/_killall.  Then
> ./configure and Makefile would be hacked to install Linux/* only on
> Linux system and in such a way that Linux/* functions would overwrite
> previously installed User/* completions.  Look quite ugly :(

I thought we had agreed that for this kind of stuff the function
itself does the test. at least _mount has been doing it for some time
now. And now _killall does the same. Dunno if the test is good enough, 
though.

On top of my previous one, obviously.

Bye
 Sven

diff -u oldcompletion/User/_killall Completion/User/_killall
--- oldcompletion/User/_killall	Fri Nov 19 09:56:05 1999
+++ Completion/User/_killall	Fri Nov 19 10:18:47 1999
@@ -1,5 +1,9 @@
 #compdef killall
 
-_alternative \
-    'signals:: _signals -p' \
-    'processes:process:{ compadd "$expl[@]" ${$(ps ho comm 2> /dev/null):#(ps|COMMAND)} }'
+if [[ "$OSTYPE" = linux* ]]; then
+  _alternative \
+      'signals:: _signals -p' \
+      'processes:process:{ compadd "$expl[@]" ${$(ps ho comm 2> /dev/null):#(ps|COMMAND)} }'
+else
+  _signals -p
+fi

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-11-20 13:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-19  9:21 Suggestion for _killall Sven Wischnowsky
1999-11-20 14:58 ` PATCH: _mount upgrade Alexandre Duret-Lutz

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).