Skip to content

mle86/clerr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clerr(1) - colorize error output

Version 1.0.5, July 2017

clerr [-1hV] [-c COLOR] COMMAND [ARGUMENTS...]

Description

clerr is a command line tool which executes another COMMAND and colorizes all error output (on stderr) of that program while its normal output (on stdout) will be printed in the default colors.

Installation

$ make
# make install

This will compile the binary and copy it to /usr/local/bin/clerr. The man page will be copied to /usr/local/share/man/man.1/clerr.1.gz.

Options

  • -1
    All output will be printed on stdout only, even error output (which will still get colorized).

  • -c COLOR
    Sets the color for error output. Default is red. Valid colors and their valid abbreviations are:

    red/re/rd, green/gr/gn, blue/bl, yellow/ye/yw, cyan/cy/cn, white/wh.

  • -h
    Prints a short help summary and exits.

  • -V
    Prints the program version and exits.

Exit Status

clerr will exit with the same status as COMMAND, if it was executed successfully. If the command was terminated due to a signal, clerr will kill itself with the same signal. Otherwise, clerr will return one of these special exit status values:

  • 1
    invocation error (e.g. syntax error or unknown option)
  • 124
    COMMAND could not be executed
  • 125
    internal error (e.g. could not fork)

Examples

  • clerr cat /etc/group-
    This will display the file /etc/group- in standard colors. If the file does not exist or the caller is not permitted to read this file, the corresponding error message (something like "cat: /etc/group-: No such file or directory") will be printed in red.
  • clerr make
    Run make in the current directory. Any compiling errors will be printed in red.

License

GNU GPL v3

Author

Maximilian Eul <maximilian@eul.cc>