[m-dev.] MERCURY_ENABLE_COLOR

Zoltan Somogyi zoltan.somogyi at runbox.com
Fri Jun 14 18:09:50 AEST 2024


On 2024-06-14 18:00 +10:00 AEST, "Peter Wang" <novalazy at gmail.com> wrote:
> On Fri, 14 Jun 2024 17:19:51 +1000 "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
>> 
>> On 2024-06-14 17:04 +10:00 AEST, "Peter Wang" <novalazy at gmail.com> wrote:
>> > Even if we didn't have the --color option, I think it still makes sense
>> > for the environment variable be able to enable *or* disable color.
>> 
>> An environment variable does already do that: NO_COLOR.
>> I don't object to setting MERCURY_ENABLE_COLOR=never
>> or MERCURY_ENABLE_COLOR=no having the same effect.
>> I just don't see the need. But I don't object either, so pick
>> the mapping from MERCURY_ENABLE_COLOR values to
>> on/off and I will implement it.
> 
> It's not necessary, no. To disable color in the Mercury compiler
> specifically, you would set MERCURY_COLOR_SCHEME=none, which is fine
> but if you're adding another environment variable anyway...
> 
> How about: MERCURY_ENABLE_COLOR=1|0|always|never

I will implement that, but I intend to document only always/never. You can then
add the documentation of 0/1 if you like; I expect I will find the text explaining
the motivation behind that to be interesting.

With this capability, there is no need for MERCURY_COLOR_SCHEME=none
or MERCURY_COLOR_SCHEME="" having the effect of turning off color.
Since documenting/understanding what MERCURY_COLOR_SCHEME does
is much simpler without it, intend to eliminate that special case. Does anyone
object?

Zoltan.


More information about the developers mailing list