Greetings and a Happy New Year to all of you :-)

Way back on Tuesday, 2019-10-01 16:07:55 +0200, Håkon Alstadheim wrote:

> Den 01.10.2019 13:28, skrev Dr Rainer Woitok:
> > ...
> >                         I'm desparately looking  for a way to get rid of
> > all the colour in the output  produced by "emerge"  but also by "qlist",
> > "eix", "e-file" and so on.
> > ...
> ...
> I've also got this in /usr/local/bin/rustc and symlinked to 
> /usr/local/bin/cargo:
> 
> ----/usr/local/bin/rustc:----
> #!/usr/bin/perl
> my @newargs=();
> my $skipnext=0;
> my $me=$0;
> $me =~ s(.*\/)();
> push @newargs, "--color";
> push @newargs, "never";
> foreach $arg (@ARGV) {
>     if($arg eq "--color"){
>       $skipnext =1;
>     } elsif($skipnext == 1){
>       $skipnext = 0;
>     } else {
>       push @newargs, $arg
>     }
> }
> exec("/usr/bin/${me}",@newargs);

I've used this script ever since  (even though  I had to slightly modify
it when I learned that  "--color=yes"  is also a valid option  which was
not detected  by the original version).   However, yesterday I found the
following:

   error: cannot specify the `--color` option with `--json`

Regardless of whether this  was a change to "rustc"  or of whether up to
now none of my builds used "rustc" with "--json": the effort to keep the
script compatible  with the current versions  of "rustc" and "cargo" now
by far outweighs the nuisance of colour in build logs for me.  Of course
anybody else's milage  might vary,  but I think  anybody else using this
script should at least know.

It was a nice workaround, though.  Thankyou Hakon :-)

Sincerely,
  Rainer

Reply via email to