zsh-workers
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <psprint@zdharma.org>
To: Bart Schaefer <schaefer@brasslantern.com>, dana <dana@dana.is>
Cc: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: Handling of *ARGZERO options, for Zsh <= 5.3
Date: Wed, 3 Jan 2018 06:14:25 +0100	[thread overview]
Message-ID: <etPan.5a4c66b1.36298646.13d7@zdharma.org> (raw)
In-Reply-To: <etPan.5a4bdf5d.6db8c70b.13d7@AirmailxGenerated.am>

On 2 stycznia 2018 at 20:35:33, Bart Schaefer (schaefer@brasslantern.com) wrote:
> On Tue, Jan 2, 2018 at 8:57 AM, dana wrote:
> >
> > If the problem is ZSH_ARGZERO, shouldn't this work in like 5.0+?
> >
> > () {
> > setopt local_options posix_argzero
> > MY_ARGZERO=$0
> > }
> 
> For considerably older (but still not the oldest) zsh you can use
> $funcfiletrace:
> 
> zmodload zsh/parameter
> print -r -- ${ZSH_ARGZERO:=${${funcfiletrace[-1]}[(ws/:/)1]}}

I'm always little afraid using this in non-debug code. Pitty that there's no at least prompt escape code (zsh var would be best) that would return path to binary.

-- 
Sebastian Gniazdowski
psprint /at/ zdharma.org


  parent reply	other threads:[~2018-01-03  5:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-02 10:17 Sebastian Gniazdowski
2018-01-02 16:57 ` dana
2018-01-02 19:35   ` Bart Schaefer
     [not found]   ` <etPan.5a4bdf5d.6db8c70b.13d7@AirmailxGenerated.am>
2018-01-03  5:14     ` Sebastian Gniazdowski [this message]
2018-01-03  5:27       ` dana
2018-01-03  7:14         ` dana
2018-01-02 19:25 ` Eric Cook
2018-01-04  2:02   ` Bart Schaefer
     [not found] ` <etPan.5a4bbc41.719c42d6.13d7@AirmailxGenerated.am>
2018-01-03  5:08   ` Sebastian Gniazdowski

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=etPan.5a4c66b1.36298646.13d7@zdharma.org \
    --to=psprint@zdharma.org \
    --cc=dana@dana.is \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@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).