Closed anko closed 2 years ago
Changing the argument will break CLI tools which use --color
for now. For instance, Stylelint.
Many UNIX tools like ls
or grep
doesn’t have --force-color
argument too. They use --color
and --color=false
/--color=auto
.
Other color libraries, for instance, chalk
doesn’t use --force-color
as well https://github.com/chalk/supports-color/blob/main/index.js
It's an entrenched enough habit that it's effectively a standard then. Better leave it that way.
Existing programs that want to migrate to this library may have a
--color
option that takes an argument, such as--color none
or--color auto
. The natural implementation of--color auto
would be to simply do nothing and let picocolors decide if colors should be on. But because the--color
flag is present inprocess.argv
(even though its intention was different), this line will always force colors on, so implementing--color auto
is impossible. Unless you do the detection yourself, which kind of defeats the point.The env variables are already called
NO_COLOR
andFORCE_COLOR
; I think it would be least surprising for the options to also be--no-color
and--force-color
. Those are pretty unambiguous.