cw

Colorizing wrapper generator for shell commands, with many pre-defined wrappers

3 years after
                              cw
                              --

          (c) 2013-2015 Reuben Thomas <[email protected]>
          (c) 2004-2010 v9/fakehalo <[email protected]>

                http://github.com/rrthomas/cw/

cw is a colorer for command-line programs. It is designed to be transparent: when you type 'du', 'df', 'ping', etc. in your shell the output is automatically colored according to a definition script, but when the commands are used non-interactively (e.g. in another script) their output is not colored, so as not to confuse programs that process their output. Text patterns are defined as lexical classes, and assigned colors. The arguments to the original program and OS under which it is running can be tested. cw includes over 50 definition scripts, and it's easy to write more.

cw is distributed under the GNU General Public License version 3, or, at your option, any later version.

Installation

Install cw using LuaRocks from http://www.luarocks.org/ :

luarocks install cw

Note: you must already have automake installed.

To use cw, you need to prepend its definition directory to the PATH environment variable. You should do this in your shell's interactive startup file (you don't want cw being run by background commands). For example, for bash and other Bourne-compatible shells, add the following line to your ~/.bashrc:

if [ -n "$PS1" ]; then PATH=cw-definitions-path:$PATH; export PATH; fi

The test of $PS1 ensures that the shell is really interactive.

Use

Start a new shell and try some commands, which should now be colored! See cw(1) (the cw man page) for more information, including details of definition scripts.

Alternatives to cw

cw doesn't try to replace some dedicated coloring wrappers and programs, such as:

ccal: http://unicorn.us.com/cal.html colorgcc: http://schlueters.de/colorgcc.html colordiff: http://www.colordiff.org/ colormake: https://github.com/pagekite/Colormake freecolor: http://www.rkeene.org/oss/freecolor/

There are also other programs like cw that you may prefer:

Crayonizer: https://sites.google.com/site/columscode/home/crayonizer acoc: http://www.caliban.org/ruby/acoc.shtml

Related Repositories

cw-omnibus

cw-omnibus

Source code to omnibus edition of _The Busy Coder's Guide to Android Development ...

cw-advandroid

cw-advandroid

Source Code to _The Busy Coder's Guide To Advanced Android Development_ ...

cw-android

cw-android

Source Code to _The Busy Coder's Guide To Android Development_ ...

CuSha

CuSha

CuSha is a CUDA-based vertex-centric graph processing framework that uses G-Shar ...

PiCW

PiCW

Raspberry Pi CW Transmitter ...


Top Contributors

rrthomas blueyed

Releases

-   v2.0.4 zip tar
-   v2.0.3 zip tar
-   v2.0.2 zip tar
-   v2.0.1 zip tar
-   v2.0.0 zip tar
-   release-v2.0.1 zip tar
-   release-v2.0.0 zip tar