Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
completion help?
- X-seq: zsh-users 1142
- From: Timothy J Luoma <luomat+zsh+users@xxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxxxxxxx
- Subject: completion help?
- Date: Sun, 16 Nov 97 20:11:53 -0500
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author