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

Re: compsys issues



    Hi Oliver :)

 * Oliver Kiddle <okiddle@xxxxxxxxxxx> dixit:
> compadd -W $PWD/$IPREFIX -f - $IPREFIX*(/:t)
> 
> That won't work with paths starting with variable expansions or
> non-relative directories. You'll need more logic to work out the
> argument to -W. Using $~IPREFIX will help resolve any expansions on the
> command line.

    Just to make sure I've understood, if I want to make it work with
absolute and relative pathnames (I'll get into variable expansions
after that), I should do something like:

    compset -P '*/'
    PREPATH="$PWD/"
    [[ $IPREFIX[1] == "/" ]] && {
        IPPREFIX=${IPPREFIX#/}
        PREPATH="/"
    }
    compadd -W $PREPATH$IPREFIX -f - ${IPREFIX}*(:t)

    Quick'n'dirty hack, but it should work, shouldn't it?

    Thanks again, Oliver :)
    
    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