help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why is -- in the output of declare -p x?


From: Peng Yu
Subject: Re: Why is -- in the output of declare -p x?
Date: Thu, 26 Jan 2023 09:23:35 -0600

"Consider the ramifications of the latter paragraph of Koichi's
response. As was stated, it is potentially useful for a program that
processes the output of `declare -p` to be able to assume that the
second word always defines the attributes and that the variable
assignment always begins from the third word."

The above is an argument for why `--` should be kept. But what if the
2nd argument starts with - then it is an option, otherwise it is not.
This is an equally valid argument why -- is not absolutely necessary.
Thus, for human readability/brevity, it should not be there.

On 1/26/23, Lawrence Velázquez <vq@larryv.me> wrote:
>> On Jan 26, 2023, at 9:13 AM, Peng Yu <pengyu.ut@gmail.com> wrote:
>> Thanks for pointing this out. This justifies that -- should be removed
>> unless it is absolutely necessary.
>
> No, it doesn’t.
>
>> So far I don't see that it is
>> absolutely necessary.
>
> And?
>
> --
> vq
> Sent from my iPhone
>


-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]