Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: compadd and an array parameter



    Hi all :)

    My excuses again for self-replying...

 * DervishD <zsh@xxxxxxxxxxxx> dixit:
[...]
>         [[ $compstate[context] = "command" ]] && compadd ${commands##*/}
[...]
>     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?

    Better 'compadd -k commands'. The keys of the 'commands'
associative array are the command names, without path. I don't know
what I was thinking...

    Sorry for the noise. What a day...

    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