Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: path PATH
On Sun, Jan 29, 2023, at 11:41 PM, Bart Schaefer wrote:
> On Sun, Jan 29, 2023 at 2:43 PM Lawrence Velázquez <larryv@xxxxxxx> wrote:
>>
>> On Sun, Jan 29, 2023, at 5:33 PM, Ray Andrews wrote:
>>
>> > BTW since 'typeset -p' claims to display information in the same format
>> > as for the recreation of the parameter:
>> >
>> > ... but if I run that output as a new command, the -H is clearly lost.
>>
>> Feels like a bug.
>
> The explicit purpose of the hideval attribute is to prevent "typeset
> -p" (and several other things) from displaying/restoring the value.
>
> -p [ N ]
> If the -p option is given, parameters and values are printed
> in the form of a typeset command with an assignment,
> regardless of other flags and options. Note that the -H flag
> on parameters is respected; no value will be shown for these
> parameters.
Hm, I was thinking about the omitted -H, not the omitted value
(which I didn't even miss, admittedly). Then again, the variable
can't be reconstructed without the value, so I'm not sure how
valuable it would be for "typeset -p" output to retain the -H.
As an aside: The "typeset -p" description is pretty clear about
hiding the value of -H parameters, but then what does "the option
does not apply if the parameter is specified by name" refer to in
the -H description?
-H Hide value: specifies that typeset will not display
the value of the parameter when listing parameters;
the display for such parameters is always as if the
`+' flag had been given. Use of the parameter is
in other respects normal, and the option does not
apply if the parameter is specified by name, or by
pattern with the -m option.
--
vq
Messages sorted by:
Reverse Date,
Date,
Thread,
Author