Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
def
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
                                  cw
                                  --

              (c) 2013-2020 Reuben Thomas <rrt@sc3d.org>
              (c) 2004-2010 v9/fakehalo <v9@fakehalo.us>

                    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.  This is free software: you are free to
change and redistribute it.  There is NO warranty, to the extent permitted
by law.



Installation
------------

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

  luarocks install cw

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

About

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

Resources

License

Packages

No packages published