zsh-users
 help / color / mirror / code / Atom feed
From: Roman Perepelitsa <roman.perepelitsa@gmail.com>
To: Mikael Magnusson <mikachu@gmail.com>
Cc: Zach Riggle <zachriggle@gmail.com>, Zsh Users <zsh-users@zsh.org>
Subject: Re: Command wrappers in $PATH, and re-executing the "correct" value
Date: Sat, 21 May 2022 09:31:42 +0200	[thread overview]
Message-ID: <CAN=4vMpN6AXkBB04m8x3Aeie3QFN3ne1_iP=rYv_LL-ueJ4k=w@mail.gmail.com> (raw)
In-Reply-To: <CAHYJk3Rz2Sqa+ZczcE1cxJGm0Yew4OskHJ+fxwGj=hTWxHc8sQ@mail.gmail.com>

On Sat, May 21, 2022 at 9:20 AM Mikael Magnusson <mikachu@gmail.com> wrote:
>
> On 5/21/22, Roman Perepelitsa <roman.perepelitsa@gmail.com> wrote:
> >
> >     path=(${path:#${commands[$1]:h}}) "$@"
>
> I'm using this in mine (wrapper script of same name as target binary),
> path[(R)$0:h]=() exec $0:t "$@"

There is a difference in behavior if the wrapper directory is listed
in PATH more than once. My version removes all of them, while yours
removes only the **last** instance. I can see a point being made for
removing the **first** but removing the last seems wrong. Is this
intended?

Roman.


      reply	other threads:[~2022-05-21  7:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-21  6:28 Zach Riggle
2022-05-21  7:12 ` Roman Perepelitsa
2022-05-21  7:20   ` Mikael Magnusson
2022-05-21  7:31     ` Roman Perepelitsa [this message]

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='CAN=4vMpN6AXkBB04m8x3Aeie3QFN3ne1_iP=rYv_LL-ueJ4k=w@mail.gmail.com' \
    --to=roman.perepelitsa@gmail.com \
    --cc=mikachu@gmail.com \
    --cc=zachriggle@gmail.com \
    --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).