zsh-workers
 help / color / mirror / code / Atom feed
* whence not behaving as expected with noaliases set
@ 2022-10-23 18:31 Stefan Schmidt
  2022-11-21  1:45 ` Matthew Martin
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Schmidt @ 2022-10-23 18:31 UTC (permalink / raw)
  To: zsh-workers

Hello!

The documentation on whence states:

> For each name, indicate how it would be interpreted if used as a command name.
https://zsh.sourceforge.io/Doc/Release/Shell-Builtin-Commands.html

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`).

    $ zsh --version
    zsh 5.9 (x86_64-apple-darwin18.7.0)
    $ zsh
    % whence curl
    /usr/bin/curl
    % /usr/bin/curl --version | head -n 1 | awk '{ print $2 }'
    7.54.0
    % alias curl=/usr/local/Cellar/curl/7.85.0/bin/curl
    % whence curl
    /usr/local/Cellar/curl/7.85.0/bin/curl
    % curl --version | head -n 1 | awk '{ print $2 }'
    7.85.0
    % setopt noaliases
    % curl --version | head -n 1 | awk '{ print $2 }'
    7.54.0
    % whence curl
    /usr/local/Cellar/curl/7.85.0/bin/curl
    % type curl
    curl is an alias for /usr/local/Cellar/curl/7.85.0/bin/curl
    % where curl
    curl: aliased to /usr/local/Cellar/curl/7.85.0/bin/curl
    /usr/bin/curl
    % which curl
    curl: aliased to /usr/local/Cellar/curl/7.85.0/bin/curl

Am I misinterpreting or misunderstanding something here or is there in fact a contradiction between the documentation and the implementation?

If there is a contradiction, what would be the recommend way to resolve it?

Cheers,
Stefan


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-21  5:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-23 18:31 whence not behaving as expected with noaliases set Stefan Schmidt
2022-11-21  1:45 ` Matthew Martin
2022-11-21  5:14   ` Bart Schaefer

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).