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

compadd and an array parameter



    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