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

Re: typeset verbosity



On 12 Jun, Peter wrote:

> (1) Make the display behaviour optional.  If so, decide when to unset
>     the option by default, e.g any sh-style emulation.
> (2) Make the display behaviour not work inside functions.  (Making it
>     not work on local parameters isn't good enough because of the -g
>     flag.)
> (3) Make it only work with typeset, or at least not work with local.
> (4) Some combination of (1) with the others.
> 
> Only (1) can ensure POSIX compatibility.  We could add a flag to display
> listed parameters instead.

For POSIX, we really ought to be accepting the -p flag which displays
the listed parameters but in a different format (in the form of a
typeset command). This typically being -L in zsh has probably been
significant in this not being done before. It might actually be a good
idea to add -p as an alternate form of -L across many builtins.

One possibility which is an extension of (3) would be to make it only
work on typeset but not for all the other typeset variants and then follow
bash in changing the documentation so declare is the recommended version
of the command (it's a better name anyway in my opinion). The
KSH_TYPESET option could be extended to make typeset also work that way
for ksh compatibility. Additionally, we could perhaps add a flag to
typeset and variants which could explicity control whether set parameters
are listed.

A related annoyance - autoload being a sort of typeset variant - is that
autoload ~/.zfunc/*(N) will not end silently if there are no files in
~/.zfunc. Changing this could perhaps be a part of whatever solution is
chosen.

Oliver

This e-mail and any attachment is for authorised use by the intended recipient(s) only.  It may contain proprietary material, confidential information and/or be subject to legal privilege.  It should not be copied, disclosed to, retained or used by, any other party.  If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender.  Thank you.



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