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

Re: path PATH



On Sun, Jan 22, 2023 at 11:31 AM Roman Perepelitsa
<roman.perepelitsa@xxxxxxxxx> wrote:
>
> Intuitively, I expected that `typeset -m pat` is equivalent
> to `typeset -p [params]..` where `[params]..` is the names of all
> parameters matching `pat`.

You can get this by combining -p and -m, which I think is one reason
why -m is different.

> > (where I'm not even sure the (q) is necessary).
>
> I think it should be (b).

Are there valid characters in an identifier name that would be quoted
differently by (b) and (q)?

I did find a bug:  describe-params -

Revised:

describe-params () {
  emulate -L zsh -o extendedglob
  set -- ${(ok)parameters[(I)${~${(j.|.)@}}]}
  while ((ARGC))
  do
    print -rn -- "${parameters[$1]} "
    if [[ -${parameters[$1]}- = *-hideval-* ]]
    then
      print -r -- ${(q-)1}
    else
      typeset -m -- ${(b)1}
    fi
    shift
  done
}




Messages sorted by: Reverse Date, Date, Thread, Author