zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: Suggestion for _killall
Date: Fri, 19 Nov 1999 10:21:23 +0100 (MET)	[thread overview]
Message-ID: <199911190921.KAA02203@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Alexandre Duret-Lutz's message of 19 Nov 1999 10:10:50 +0000


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


             reply	other threads:[~1999-11-19  9:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-19  9:21 Sven Wischnowsky [this message]
1999-11-20 14:58 ` PATCH: _mount upgrade Alexandre Duret-Lutz
  -- strict thread matches above, loose matches on Subject: below --
1999-11-19  8:55 Suggestion for _killall Sven Wischnowsky
1999-11-18 21:24 Falk Hueffner
1999-11-19 10:10 ` Alexandre Duret-Lutz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199911190921.KAA02203@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).