zsh-users
 help / color / mirror / code / Atom feed
From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: 'whence' question
Date: Thu, 06 Nov 2014 13:45:51 -0800	[thread overview]
Message-ID: <545BEC0F.8080805@eastlink.ca> (raw)
In-Reply-To: <141105204330.ZM2973@torch.brasslantern.com>

On 11/05/2014 08:43 PM, Bart Schaefer wrote:
> The pattern accepted by the -m option is not a glob,

That seems very counterintuitive!  I'm taking it as a regular glob just 
as, I think,
anyone would.
> it's a pattern of
> the string-matching variety.  If we were to simply glue each of the
> arguments onto the end of each $path directory and glob the resulting
> cross-product, the wrong results could be returned.  Furthermore, for
> e.g. cygwin, the filled hash table has dealt with mapping "foo.exe"
> onto "foo" with the suffix case-insensitive, so even a string match
> against the file names across $path could be wrong.
>
> Having just written that, it occurs to me that perhaps the "right way"
> is the equivalent of this? --
>
> 	whence -a ${(k)commands[(I)pattern]}
I couldn't get any love from that.  What I do in my wrapper is this:

     echo -e "\n\e[31;1mACTIVE:\n\e[0m`whence -mv "$1"`"
     echo -e "\n\e[31;1mSHADOWED AND/OR LINKS:\
                   \n\e[0m`whence -sav "${1//'*'/}"`"



> $ i zsh* << (i)nformation = mostly from whence.

> ACTIVE:
> zsh is /usr/local/bin/zsh
> zsh-ok is /usr/local/bin/zsh-ok
> zsh-test1 is /usr/local/bin/zsh-test1
> zsh-test2-orig-rebuild is /usr/local/bin/zsh-test2-orig-rebuild
>
> SHADOWED AND/OR LINKS:
> zsh is /usr/local/bin/zsh -> /usr/local/bin/zsh-test2-orig-rebuild
> zsh is /usr/bin/zsh -> /usr/local/bin/zsh-test2-orig-rebuild
> zsh is /bin/zsh -> /usr/local/bin/zsh-test2-orig-rebuild
>
... which is a bit clumsy, but if I type ' i zsh* ' I want 'whence-ish' 
information on
the intuitive meaning of 'zsh*' and I want to see links, and 'shadowed' 
files
because they may very well be part of a chain of links, as is true 
above. But '-m'
won't permit '-s', and '-a' won't permit glob.  I hope that something more
friendly can be come up with. I hope it's " whence -as "zsh*" "


  reply	other threads:[~2014-11-06 21:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-05 18:33 Ray Andrews
2014-11-05 17:49 ` Oliver Kiddle
2014-11-05 18:00   ` Peter Stephenson
2014-11-06  4:43     ` Bart Schaefer
2014-11-06 21:45       ` Ray Andrews [this message]
2014-11-06 21:53         ` Bart Schaefer
2014-11-06 23:15           ` Ray Andrews
2014-11-06 22:54             ` Bart Schaefer
2014-11-05 19:15   ` Ray Andrews
2014-11-05 17:50 ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=545BEC0F.8080805@eastlink.ca \
    --to=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).