Gentoo Archives: gentoo-user

From: Dr Rainer Woitok <rainer.woitok@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Globally disabling colour
Date: Sun, 05 Jan 2020 12:06:16
Message-Id: 24081.53546.424507.967383@woitok.gmail.com
1 Greetings and a Happy New Year to all of you :-)
2
3 Way back on Tuesday, 2019-10-01 16:07:55 +0200, Håkon Alstadheim wrote:
4
5 > Den 01.10.2019 13:28, skrev Dr Rainer Woitok:
6 > > ...
7 > > I'm desparately looking for a way to get rid of
8 > > all the colour in the output produced by "emerge" but also by "qlist",
9 > > "eix", "e-file" and so on.
10 > > ...
11 > ...
12 > I've also got this in /usr/local/bin/rustc and symlinked to
13 > /usr/local/bin/cargo:
14 >
15 > ----/usr/local/bin/rustc:----
16 > #!/usr/bin/perl
17 > my @newargs=();
18 > my $skipnext=0;
19 > my $me=$0;
20 > $me =~ s(.*\/)();
21 > push @newargs, "--color";
22 > push @newargs, "never";
23 > foreach $arg (@ARGV) {
24 > if($arg eq "--color"){
25 > $skipnext =1;
26 > } elsif($skipnext == 1){
27 > $skipnext = 0;
28 > } else {
29 > push @newargs, $arg
30 > }
31 > }
32 > exec("/usr/bin/${me}",@newargs);
33
34 I've used this script ever since (even though I had to slightly modify
35 it when I learned that "--color=yes" is also a valid option which was
36 not detected by the original version). However, yesterday I found the
37 following:
38
39 error: cannot specify the `--color` option with `--json`
40
41 Regardless of whether this was a change to "rustc" or of whether up to
42 now none of my builds used "rustc" with "--json": the effort to keep the
43 script compatible with the current versions of "rustc" and "cargo" now
44 by far outweighs the nuisance of colour in build logs for me. Of course
45 anybody else's milage might vary, but I think anybody else using this
46 script should at least know.
47
48 It was a nice workaround, though. Thankyou Hakon :-)
49
50 Sincerely,
51 Rainer

Replies

Subject Author
Re: [gentoo-user] Globally disabling colour Robert Bridge <robert@××××××××.com>