zsh-workers
 help / color / mirror / code / Atom feed
* killall completion
@ 1999-12-09  4:35 Johan Sundström
  1999-12-09 23:47 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Johan Sundström @ 1999-12-09  4:35 UTC (permalink / raw)
  To: zsh-workers

Hi!

Yet another old-style/compctl completion, this time for killall; perhaps
worth including in zsh completion archive batch supplied with zsh:s? It's
designed for the ps of SunOS 5.7 or the ps shipped with Red Hat Linux
(where ps --version says "procps version 1.2.7").

functions complete-killall () 
{
  if [[ "$(uname)" == "SunOS" ]]; then
      reply=($(ps -o comm|sed '1d;s/^-//'|awk -F/ '{print $NF}'|sort|uniq))
  else
      reply=($(ps alwww|cut -b72-|egrep -v '^\('|sed '1d;s/^-//;s/ .*//'|awk -F/ '{print $NF}'|sort|uniq))
  fi
}

compctl -K complete-killall killall

Could be improved by somehow filtering out the commands of the pipe chain
from the completion namespace, but I couldn't come up with a working
scheme within five minutes, so I dropped the idea. :-)

Other possible future improvement is a wider process scope (ps -a/-e
respectively) if UID==0. Comments, improvements and general thoughts
always welcome!

 /Johan Sundström (non-subscriber)


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

* Re: killall completion
  1999-12-09  4:35 killall completion Johan Sundström
@ 1999-12-09 23:47 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 1999-12-09 23:47 UTC (permalink / raw)
  To: zsh-workers, Johan Sundström

Johan Sundstr m wrote:
> Hi!
> 
> Yet another old-style/compctl completion, this time for killall; perhaps
> worth including in zsh completion archive batch supplied with zsh:s?

On the whole, I'm not expecting much to be added to the old-style
completion functions.  I realise it's hard to write new ones from scratch
and we should include a minimal description and pointers of what else to
read.

If anyone does want to add new compctl examples, which doesn't hurt, could
they please send patches, it makes life much easier (more work for them, of
course).

pws
-- 
Peter Stephenson <pws@pwstephenson.fsnet.co.uk>


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

end of thread, other threads:[~1999-12-09 23:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-09  4:35 killall completion Johan Sundström
1999-12-09 23:47 ` Peter Stephenson

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).