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

Re: 'whence' question



On 11/05/2014 09:49 AM, Oliver Kiddle wrote:
Ray Andrews wrote:
... yet, although '/usr/local/bin/zsh' is found, all of the other files
found by
'whence -a zsh' above are missed. How is it that '/usr/local/bin/zsh'
matches
'zsh*' but '/bin/zsh' does not?
Because /bin/zsh is hidden by /usr/local/bin/zsh. The commands are in a
hash table and there is only the one entry for zsh.

Looking at the source, it seems that whence doesn't support both -a and
-m together though it doesn't produce an error.
You anticipate me.  '-am' was the first 'cure' I tried.
I'd agree that this isn't ideal. Note that whence -m does show a zsh
alias in addition to /usr/local/bin/zsh if there is one.
I'm not sure what the intuitive answer might be. As Peter said, '-m' finds only the first *active* match, whereas '-a' pointedly keeps looking. Perhaps '-a' might accept wildcards? That would leave '-m' alone, but expand the usefulness of '-a' without (I hope) breaking anything.




Messages sorted by: Reverse Date, Date, Thread, Author