From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11452 invoked by alias); 3 Jan 2018 05:14:34 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42201 Received: (qmail 12538 invoked by uid 1010); 3 Jan 2018 05:14:34 -0000 X-Qmail-Scanner-Diagnostics: from aok120.rev.netart.pl by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(85.128.245.120):SA:0(-1.9/5.0):. Processed in 7.082002 secs); 03 Jan 2018 05:14:34 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: psprint@zdharma.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | X-Virus-Scanned: by amavisd-new using ClamAV (5) Date: Wed, 3 Jan 2018 06:14:25 +0100 From: Sebastian Gniazdowski To: Bart Schaefer , dana Cc: "=?utf-8?Q?zsh-workers=40zsh.org?=" Message-ID: In-Reply-To: References: <786CAD82-87B3-4ECD-BFDF-99E7D4E1D5F3@dana.is> Subject: Re: Handling of *ARGZERO options, for Zsh =?utf-8?Q?<=3D_?=5.3 X-Mailer: Airmail (442) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline 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