Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: whence (was Re: local unfunction)
- X-seq: zsh-users 23296
- From: Ray Andrews <rayandrews@xxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: whence (was Re: local unfunction)
- Date: Sat, 31 Mar 2018 10:21:01 -0700
- In-reply-to: <CAH+w=7Zz4HMfB_RA5nHr_i_iwKvD=S0QOjcogc0Y0OYSXv0JXw@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAH+w=7Zz4HMfB_RA5nHr_i_iwKvD=S0QOjcogc0Y0OYSXv0JXw@mail.gmail.com>
On 31/03/18 08:25 AM, Bart Schaefer wrote:
% whence -wm "zsh*"
$ whence -wm "zsh*"
zsh: command
zsh5.3: command # binary
zsh5.3:: command # text file
... I've yet to understand what the point of the '-w' switch is. I dunno
Bart, it seems I'm the only guy who has issues with whence so perhaps I
shouldn't belabour all this but it seems riddled with bugs to me. '-m'
and '-a' seem to fight each other and the results are inconclusive.
whence is important, one needs to know what is going to be executed when
one types a command, these ifs and buts are frustrating. My wrapper
around whence is approaching 300 lines, and it's only purpose is to give
one-stop shopping for what, it seems to me, whence should do anyway:
-a # keep looking after the first match (the one to be executed) is found
-m # find all matches of a pattern, subsumes '-a' (executable ONLY
unless ... )
-t # Show non executable (text?) files as well, obviates -a, subsumes 'm'.
-s, -S # Expand links, even if found on 'dot' on the path.
So: 'whence -mts "zsh*" ' ... would give me one stop shopping for
anything that is either directly executable or sourcable via path search
(which zsh does anyway). '-a' is actually redundant:
$ whenz zsh # Command that will be executed.
$ whenz -m zsh # Keep searching. (no pattern but so what, keep searching
anyway.)
$ whenz -m "zsh*" # Keep searching and match the pattern too (because
one is given).
$ whenz -mt "zsh*" # As above, but match non executables on the path as
well.
$ whenz -mtS "zsh*" As above but show link chains, even on the 'dot',
even on Tuesdays.
Logical?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author