Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: whence not behaving as expected with noaliases set
- X-seq: zsh-workers 51012
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Stefan Schmidt <Stefan.Schmidt@xxxxxx>, zsh-workers@xxxxxxx
- Subject: Re: whence not behaving as expected with noaliases set
- Date: Sun, 20 Nov 2022 21:14:57 -0800
- Archived-at: <https://zsh.org/workers/51012>
- In-reply-to: <Y3rYRgGp+QQDqqKI@CptOrmolo.darkstar>
- List-id: <zsh-workers.zsh.org>
- References: <trinity-79c2b1d1-c907-48b5-ba61-26c0c72b7b6f-1666549918615@3c-app-gmx-bap60> <Y3rYRgGp+QQDqqKI@CptOrmolo.darkstar>
On Sun, Nov 20, 2022 at 5:46 PM Matthew Martin <phy1729@xxxxxxxxx> wrote:
>
> On Sun, Oct 23, 2022 at 08:31:58PM +0200, Stefan Schmidt wrote:
> >
> > This works as expected if an alias is defined but if the `noaliases` option is set `whence` still returns the alias (same for `type`, `where` and `which`).
>
> > Am I misinterpreting or misunderstanding something here or is there in fact a contradiction between the documentation and the implementation?
>
> I think your interpretation is correct. This seems straight forward
> enough to fix.
I'm not sure there was intended to be an implication that "whence"
would pay attention to noaliases. If used inside an "autoload -U"
function, for example, it's also going to report the "wrong" thing for
any command names used in that function, regardless of the global
setopt.
If we apply this change, I wonder if we should also extend the -a
option to continue to list aliases despite its current description of
"throughout the command path". It already lists builtins as well as
$path locations.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author