zsh-users
 help / color / mirror / code / Atom feed
* completion help?
@ 1997-11-17  1:11 Timothy J Luoma
  1997-11-17  2:48 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Timothy J Luoma @ 1997-11-17  1:11 UTC (permalink / raw)
  To: zsh-users


I've never really understood completions functions.

I have two commands "run" and "open -a" which I would like to be able to  
supply Application's names to.

I can get the names of the applications using this:

sed 's/.*\///g' ~/.AppInfo/LaunchBar/Setup|sed 's/\.app$//g'

(~/.AppInfo/LaunchBar/Setup is an ASCII file, one app per line)

How can I make a function that will allow me to do:

run [tab]

to cycle through the apps and

run S[tab]

to cycle through the apps which start with an 'S'?


I tried this (adapted from something someone gave me for something else)


allapps ()
   {
   apppath=(`sed 's/.*\///g' ~/.AppInfo/LaunchBar/Setup \
   | sed 's/\.app$//g'`)
   reply=$apppath;
   }


compctl -K allapps 'S[-]' -- run

but when I hit tab nothing happens....

Clues for the clueless?

TjL


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

end of thread, other threads:[~1997-11-17  3:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-11-17  1:11 completion help? Timothy J Luoma
1997-11-17  2:48 ` Bart Schaefer

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