Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Can this snippet be further improved?
- X-seq: zsh-workers 51998
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Can this snippet be further improved?
- Date: Fri, 28 Jul 2023 09:53:33 -0500
- Archived-at: <https://zsh.org/workers/51998>
- List-id: <zsh-workers.zsh.org>
I'm preparing update to zsh plugin standard. It's about getting the
path to the sourced (….plugin.zsh) script. The current version is:
0=${${ZERO:-${(%):-%x}}:A}
I wonder if it could be improved? The current version:
- favors ZERO,
- falls back to %x if ZERO is empty,
- makes the path absolute,
- resolved symlinks and ,,./ components.
Is there a bug or improvement that's possible?
--
Best regards,
Sebastian Gniazdowski
Messages sorted by:
Reverse Date,
Date,
Thread,
Author