CLI Reference for v3.0.0 and over
Usage
Available Options
-s, --symbol-list
Shows symbol list that can to specify in foreground_color, background_color, text_attr.
-l, --index-list
Shows color index list that can to specify in foreground_color, background_color.
For example, When you would like to specify number 60, you must specify index60
.
-p, --pickup "pattern[,foreground_color[,background_color[,text_attribute]]]"
Decorates your specified pattern. You can use this option many times.
If you don’t specify foreground_color, will be used cyan as foreground_color for matches pattern. You have to escape with backslash, when your pattern is included comma, double quote, backslash etc.
-f
,-b
,t
options will be used with the exception of string that matches pattern.
-p
option accept four arguments as below -p pattern,foreground,background,text_attribute
.
String that matches pattern will be decorated by -p
option arguments.
So version 3.0.0
and over can to specify decoration each -p
option.
When pattern is surrounded by backslash like /pattern/
, It will be work as regular expression.
-H, --hightlight "foreground_color[,background_color[,text_attribute]]"
Highlight lines that match pattern which is specified by -p
option.
A first of -p
option correspond to a first of -H
option, also a second of -p
option correspond to a second of -H
option.
That’s why you can specify this options only same number as -p
options.
If two and over patterns are matched in one line, -H
option will be used that you specified at first.
In case you specfied -H options more than -p
options, surplus of -p
option correspond to a first of -H
option.
-f, --fg color_name
Specifies foreground color. You can see the list of value by colorecho -s
and also colorecho -l
.
-b, --bg color_name
Specifies background color. You can see the list of value by colorecho -s
and also colorecho -l
.
-t, --tx text_attribute[,...]
Specifies background color. You can see the list of value by colorecho -s
.
This option can to specify many values like that -t underline,bold,blink
.
-w, --watch
Keeps wait for standard input.
You can exit this mode follows keywords exit
,quit
,bye
or Ctl + c
.
--stripe
Decorates on every other line.
When you specified this option, -p option will be ignored. You can’t use --stripe
option and -p
option at the same time.
When you don’t specify any decoration by -f
,-b
,-t
option, will be used cyan as value of -f
option.
-r, --refresh-match
Tries to delete sequence code from input that matches -p option’s pattern.
-R, --refresh
Tries to delete sequence code from input.
But It will works when you specified -f
,-b
,-t
,-p
options.
- This example to add
index205
color to the whole foreground, And then addindex156
color to foreground on every other line. The whole foreground has already colored withindex205
, That’s why must to delete the sequence code before addindex156
color on every other line.
-c file_name,...
Reads options from your specify file.
You can specify many files as -c foo,bar,baz
.
If you have duplicated option name, a previous file be given priority over a subsequent file.
When you have ~/.colorecho/default or $COLORECHO/default, You souldn’t specify -c default
because a default file will be read automatically.
More information is Check About option reading from file.
-n
Do not output the trailing newline.
-e
Enable interpretation of line feed.
-v
Shows version of color_echo.
-h, --help
Shows help message.
Example
You are looking for status code 4xx, 5xx.
Let’s turn color of 4xx
yellow, turn color of 5xx
red, and turn foreground color gray to be emphasized.
Easy to find that now.
But options are rather long. So let’s move these to a file to call whenever you want.
When you specify options from file, shouldn’t escape \
or "
to \\
or \"
by backslash.
Let’s save that as ~/.colorecho/status_code
, and then you can call that by -c status_code
.
You can watch access log as the file grows by combination of tail
, colorecho
.
You can use many kind of command with colorecho
because colorecho
can to receive standard input and also wait it.