Miscellaneous README spelling and grammar tweaks

This commit is contained in:
Brian Foley 2013-06-06 20:06:34 +01:00
commit fca426ca06

View file

@ -1,5 +1,5 @@
colout(1) -- Color Up Arbitrary Command Ouput
=============================================
colout(1) -- Color Up Arbitrary Command Output
==============================================
## SYNOPSIS
@ -16,9 +16,9 @@ matching a given regular expression *PATTERN* in given <COLOR> and *STYLE*.
If groups are specified in the regular expression pattern, only them are taken
into account, else the whole matching pattern is colored.
You can specify severall colors or styles when using groups by separating them
You can specify several colors or styles when using groups by separating them
with commas. If you indicate more colors than groups, the last ones will be ignored.
If you ask for less colors, the last one will be duplicated across remaining
If you ask for fewer colors, the last one will be duplicated across remaining
groups.
Available colors are: blue, black, yellow, cyan, green, magenta, white, red,
@ -30,8 +30,8 @@ rapid_blink, reverse, conceal or random (some styles may have no effect, dependi
on your terminal).
`rainbow` will cycle over a 8 colors rainbow at each matching pattern.
`Rainbow` will do the same over 24 colors (necessitate a terminal compatible
with 256-colors mode).
`Rainbow` will do the same over 24 colors (this requires a terminal that supports
the 256 color escape sequences).
`Random` will color each matching pattern with a random color among the 255
available in the ANSI table. `random` will do the same in 8 colors mode.
@ -47,11 +47,11 @@ If GIMP palettes files (*.gpl) are available, you can also use their names as a
colormap (see the `-P` switch below).
Note that the RGB colors (either the hex triplets or the palettes's colors) will
be converted to their nearest ANSI 256-colors mode equivalents.
be converted to their nearest ANSI 256 color mode equivalents.
When not specified, a *COLOR* defaults to _red_ and a *STYLE* defaults to _bold_.
`colout` comes with some predefined themes to rapidely color well-known outputs
`colout` comes with some predefined themes to rapidly color well-known outputs
(see the `-t` switch below).
If the python-pygments library is available, `colout` can be used as an interface
@ -67,14 +67,15 @@ use the `-r` switch (see below).
sudo python setup.py install
and then soft link `/usr/local/bin/colout` to your colout.py under your installaion directory, which usually like
and then soft link `/usr/local/bin/colout` to your colout.py under your installation
directory, which is usually something like
/usr/local/lib/python2.7/dist-packages/colout-0.1-py2.7.egg/colout/colout.py
## OTHER INSTALLATION METHOD
Pypi(the Python Package Index)
Pypi (the Python Package Index)
sudo pip install colout
@ -127,7 +128,7 @@ Gentoo overlay
## OPTIONS
* `-h`, `--help`:
Show an help message and exit
Show a help message and exit
* `-g`, `--groups`:
For color maps (like "rainbow"), iterate over matching groups in the pattern instead of over patterns.
@ -136,7 +137,7 @@ Gentoo overlay
Use the given list of comma-separated colors as a colormap (cycle the colors at each match).
* `-a`, `--all`
Color the whole input at once instead of line per line (really useful
Color the whole input at once instead of line by line (really useful
for coloring a source code file with strings on multiple lines).
* `-l min,max`, `--scale min,max`:
@ -160,9 +161,9 @@ for coloring a source code file with strings on multiple lines).
Print the names of all available colors, styles, themes and palettes.
* `-s`, `--source`:
Interpret PATTERN as a source code readable by the Pygments library. If the first letter of PATTERN
is upper case, use the 256 colors mode, if it is lower case, use the 8 colors mode.
In 256 colors, interpret COLOR as a Pygments style (e.g. "default").
Interpret PATTERN as source code readable by the Pygments library. If the first letter of PATTERN
is upper case, use the 256 color mode, if it is lower case, use the 8 colors mode.
In 256 color mode, interpret COLOR as a Pygments style (e.g. "default").
* `--debug`:
Debug mode: print what's going on internally, if you want to check what features are available.
@ -173,14 +174,14 @@ for coloring a source code file with strings on multiple lines).
A regular expression (or _regex_) is a pattern that describes a set of strings
that matches it.
`colout` understands regex as specifed in the _re_ python module. Given that
`colout` understands regex as specified in the _re_ python module. Given that
`colout` is generally called by the command line, you may have to escape
special characters that would be recognize by your shell.
## DEPENDENCIES
Recommended packages :
Recommended packages:
* `argparse` for a usable arguments parsing
* `pygments` for the source code syntax coloring
@ -194,7 +195,7 @@ Don't use nested groups or colout will duplicate the corresponding input text wi
## EXAMPLES
* Color in bold red every occurence of the word _color_ in colout sources:
* Color in bold red every occurrence of the word _color_ in colout sources:
`cat colout.py | colout color red bold`
* Color in bold violet home directories in _/etc/passwd_:
@ -230,16 +231,16 @@ Don't use nested groups or colout will duplicate the corresponding input text wi
`make 2>&³ | colout -t cmake | colout -t g++`
* Color each word in the head of auth.log with a rainbow color map, starting a new colormap at each new line (the
begining of the command is just bash magic to repeat the string "(\\w+)\\W+":
beginning of the command is just bash magic to repeat the string "(\\w+)\\W+":
`L=$(seq 10) ; P=${L//??/(\\w+)\\W+} ; head /var/log/auth.log | colout -g "^${P}(.*)$" rainbow`
* Color each line of a file with a different color among a 256 color gradient from cyan to green:
`head /var/log/auth.log | colout -c "^.*$" 39,38,37,36,35,34`
* Color a source code in 8 colors mode, without seeing comments:
* Color source code in 8 colors mode, without seeing comments:
`cat colout.py | grep -v "#" | colout -s python`
* Color a source code in 256 colors mode:
* Color source code in 256 color mode:
`cat colout.py | colout -s Python monokai`
* Color a JSON stream: