Git Product home page Git Product logo

colorgcc's Introduction

colorgcc

Version: 1.4.5

A wrapper to colorize the output from compilers whose messages
match the "gcc" format.

Requires the ANSIColor module from CPAN. 
Requires also the modules Open3, Basename, Spec and Cwd.


Usage:

Option 1)
In a directory that occurs in your PATH _before_ the directory
where the compiler lives, create a softlink to colorgcc for
each compiler you want to colorize:

   gcc -> colorgcc
   g++ -> colorgcc
   cc  -> colorgcc
   c++ -> colorgcc
   etc.

That's it. When "g++" is invoked, colorgcc is run instead.
colorgcc looks at the program name to figure out which compiler to run.

Option 2)
In a directory in your PATH, create the following links to colorgcc:
   color-g++ -> colorgcc
   color-c++ -> colorgcc
   color-gcc -> colorgcc
   color-cc  -> colorgcc
Then override the compiler macros for make, for example:
   make CXX=color-g++ CC=color-gcc

The default settings can be overridden with ~/.colorgccrc.
See the comments in the sample .colorgccrc for more information.

Note:

colorgcc will only emit color codes if:

   (1) Its STDOUT is a tty and
   (2) the value of $TERM is not listed in the "nocolor" option.

If colorgcc colorizes the output, the compiler's STDERR will be
combined with STDOUT. Otherwise, colorgcc just passes the output from
the compiler through without modification.

Author: Jamie Moyers <[email protected]>
Started: April 20, 1999
Licence: GNU Public License

colorgcc's People

Contributors

foobarrior avatar hzy199411 avatar jbenet avatar jflemer avatar johannes avatar malvineous avatar marticak avatar olibre avatar stevenhoneyman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

colorgcc's Issues

Please provide an option to run as filter

Colorgcc could have a filter mode, reading gcc output from stdin and colorizing it. This allows the use of colorgcc only in particular occasions and also allows its use in constrained environments where the main gcc is not editable and gcc is called directly with its full path.

Colorize already-output text files?

Hey guys!

Great project here. The only thing keeping me from using it at work, where it would be great, is that we use a very involved compiling infrastructure and I'm not sure if replacing anything in my path will break things. For me, it would be easier to pass the output to colorgcc after the fact and have it color it then. Is it possible to do this?

'Use of uninitialized value $dir' warning

Use of uninitialized value $dir in string eq at /usr/lib/colorgcc/bin/g++ line 275.
Use of uninitialized value $dir in concatenation (.) or string at /usr/lib/colorgcc/bin/g++ line 278.

Force color even if terminal is not STDOUT

I needed to further process the output of colorgcc with another perl script through piping, and ran across the problem that colorgcc doesn't color the output if the terminal is not STDOUT. Many standard Linux programs allow you to use the --color or --color=always flag which forces the output of colors anyway. Can this functionality be added?

treats #pragma message as an error

in GCC 4.7.2

pragma message ("fixme: audit table->visitors")

produces:
poker.c: In function ‘pk_CheckWait’:
poker.c:191:11: note: #3 pragma message: fixme: audit table->visitors

On my system, it shows up in the same colour as error messages rather than either the same as warning or preferably it's own colour.

localization support

Subject: Fwd: [Fwd: colorgcc upgrade for localization of "warning"]
Date: 04/23/09 12:00:56 AM (Wed, 22 Apr 2009 18:00:56 -0400)

Johannes,

Based on someone else's suggestion
(http://bugs.gentoo.org/show_bug.cgi?id=168709), I've updated colorgcc
to be language aware. However, I don't know perl. Do you know perl well
enough to clean up what I've done? Even if you don't, are you willing to
host the upgraded colorgcc on your site (once it is cleaned up)?

The modifications to the perl script are as follows:
Replace the regex that looks for "warning" with a variable. That
variable's value is retrieved from a file based on the current language
setting. If the language key is not found, a quick compile is done to
determine the value and it is appended to the lookup file.

Example:

LANG=en_us

in warnings_db.txt:
en_us=warning

It still needs some work to be more portable and to facilitate
installers. I've included the new function below.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.