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

Re: Is this a bug or I'm completely lost?



    Hi Peter :)

 * Peter Stephenson <pws@xxxxxxx> dixit:
> > It certainly appears that this is the intentional behavior of compadd -k, 
> > based on a look at the code.  If you specify multiple arrays in a single 
> > compadd, they're assumed to indicate a preference ordering (e.g. nameddirs 
> > xor userdirs) whereas if you use separate compadds they're cumulative.  
> It's hard to believe it's a useful feature.  grep suggests it's not
> used.  I can't see what you'd use it for.  Doesnt' ${array:-$array2}, or
> something similar do it more clearly?

    Yes if the behaviour is 'xor', but I was looking for something
different: if no matches in the first array, try the second. That's
not 'if the first array is empty, try the second'.

    Currently you have 'if no matches in the first array, don't even
try the second' behaviour.

    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