Skip to content

Commit ed4ac0c

Browse files
sur5rlundmar
authored andcommitted
Support NO_COLOR env variable as per no-color.org
1 parent d45c9b1 commit ed4ac0c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/options.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,11 @@ void options_parse(int argc, char *argv[])
236236
exit(EXIT_SUCCESS);
237237
}
238238

239+
// Support no-color.org informal spec
240+
char *no_color = getenv("NO_COLOR");
241+
if(no_color != NULL && no_color[0] != '\0')
242+
option.color = -1;
243+
239244
while (1)
240245
{
241246
static struct option long_options[] =

0 commit comments

Comments
 (0)