Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Why no parameter flag for extendedglob?
- X-seq: zsh-workers 30559
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Why no parameter flag for extendedglob?
- Date: Tue, 03 Jul 2012 08:26:25 -0700
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author