Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Why no parameter flag for extendedglob?



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