Support NO_COLOR env variable as per no-color.org

This commit is contained in:
Jakob Haufe 2024-03-06 13:27:08 +01:00
parent d45c9b1a22
commit 02663f45ed
No known key found for this signature in database
GPG key ID: 4CF2B218F54DAE3D

View file

@ -236,6 +236,11 @@ void options_parse(int argc, char *argv[])
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
} }
// Support no-color.org informal spec
char *no_color = getenv("NO_COLOR");
if(no_color != NULL && no_color[0] != '\0')
option.color = -1;
while (1) while (1)
{ {
static struct option long_options[] = static struct option long_options[] =