Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Handling of *ARGZERO options, for Zsh <= 5.3



On 2 stycznia 2018 at 20:35:33, Bart Schaefer (schaefer@xxxxxxxxxxxxxxxx) 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



Messages sorted by: Reverse Date, Date, Thread, Author