Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
compadd and an array parameter
- X-seq: zsh-users 8126
- From: DervishD <zsh@xxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxxxxx>
- Subject: compadd and an array parameter
- Date: Tue, 26 Oct 2004 18:59:02 +0200
- Mail-followup-to: Zsh Users <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: DervishD
Hi all :)
I'm playing (again) with the completion code, and I've written
something like this:
bindkey "^O" completer
zle -C completer expand-or-complete completer
function completer () {
[[ $compstate[context] = "command" ]] && compadd ${commands##*/}
return 0
}
Well, what I want is to complete using the contents of the
'commands' array, but with the path stripped, but I think that the
compadd command above will lead to a very big expansion. Can I tell
compadd something like 'compadd -a commands' and something more to
make it strip the path or the expansion above is the only way?
Of course, I could examine 'CURRENT', perform a match and include
only that match in the compadd command line, but I'm curious...
Thanks a lot in advance :)
Raúl Núñez de Arenas Coronado
--
Linux Registered User 88736
http://www.dervishd.net & http://www.pleyades.net/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author