zsh-users
 help / color / mirror / code / Atom feed
* What's the opposite of ZSH_ARGZERO?
@ 2024-03-06 21:56 Felipe Contreras
  2024-03-07  5:16 ` Bart Schaefer
  0 siblings, 1 reply; 8+ messages in thread
From: Felipe Contreras @ 2024-03-06 21:56 UTC (permalink / raw)
  To: Zsh Users

Hi,

In order to write code that always uses the POSIX $0 regardless of the
POSIX_ARGZERO option one can simply use ZSH_ARGZERO.

But what if someone wants to do the opposite? Use the zsh $0 even if
POSIX_ARGZERO is on?

So far I've found that ${(%):-%N} is the best option, but I wonder if
there is a better one.

Either way it would be nice if there was a variable for that, say ZSH_0.

This also might simplify the zsh plugin standard:

https://wiki.zshell.dev/community/zsh_plugin_standard

Cheers.

-- 
Felipe Contreras


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

end of thread, other threads:[~2024-03-17 21:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-06 21:56 What's the opposite of ZSH_ARGZERO? Felipe Contreras
2024-03-07  5:16 ` Bart Schaefer
2024-03-15 16:28   ` What's the equivalent of ${BASH_SOURCE[0]}? Felipe Contreras
2024-03-16  5:07     ` Bart Schaefer
2024-03-16  9:33       ` Felipe Contreras
2024-03-17 21:36         ` Bart Schaefer
2024-03-16  9:43     ` Roman Perepelitsa
2024-03-16 11:59       ` Felipe Contreras

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