* Why no parameter flag for extendedglob?
@ 2012-07-03 15:26 Bart Schaefer
0 siblings, 0 replies; only message in thread
From: Bart Schaefer @ 2012-07-03 15:26 UTC (permalink / raw)
To: zsh-workers
So I'm writing this in a recent zsh-users reply:
setopt extendedglob
(( $# )) && argv[-1]="${argv[-1]/(#s)(#b)([^-])/--use=$match[1]}"
And suddenly I'm wondering why I wasn't writing e.g. this:
(( $# )) && argv[-1]="${(*)argv[-1]/(#s)(#b)([^-])/--use=$match[1]}"
Maybe (*) isn't the ideal character to choose to mean "use extendedglob
for this expansion" [although it's currently not used and a reasonable
mnemonic], but it just seems so ridiculously useful to be something that
was not thought of before.
I suppose the precedents ${^x} ${=x} ${~x} are all implemented without
the parenthesised-flags syntax and there aren't any remaining ways to
build such an expression. Still.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-07-03 15:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-03 15:26 Why no parameter flag for extendedglob? Bart Schaefer
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).