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

What is the '+' option of the 'typeset' builtin supposed to do?



The documentation states the following:

If ‘+’ appears by itself in a separate word as the last option, then the names of all parameters (functions with -f) are printed, but the values (function bodies) are not. If name arguments appear, both those names and their values are printed in the form of assignments. It is an error for any other options to follow ‘+’, but the effect of ‘+’ is as if all attribute flags which precede it were given with a ‘+’ prefix. For example, ‘typeset -U +’ is equivalent to ‘typeset +U’ and displays the names of all arrays having the uniqueness attribute, whereas ‘typeset -f -U +’ displays the names of all autoloadable functions. If ‘+’ is the only option, then type information (array, readonly, etc.) is also printed for each parameter, in the same manner as ‘typeset +m "*"’.

I understand this as meaning that the '+' option is a mechanism to print information about existing parameters. There are however a number of scenarios where nothing is printed and parameters are modified or created while '+' is present:
Is all of the above expected or should the parameter modifications/creations be considered as bugs? 

Philippe



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