Request: Check for `--force-color` instead of `--color`
anko opened this issue · 2 comments
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 in process.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
and FORCE_COLOR
; I think it would be least surprising for the options to also be --no-color
and --force-color
. Those are pretty unambiguous.
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.