1 .TH COLORIZE 1 "2019-08-22" "colorize v0.64" "User Commands"
3 colorize \- colorize text on terminal with ANSI escape sequences
5 \fBcolorize\fR [\fIoption\fR]... (\fIforeground\fR) [\fI-|file\fR]
7 \fBcolorize\fR [\fIoption\fR]... (\fIforeground\fR)/(\fIbackground\fR) [\fI-|file\fR]
9 \fBcolorize\fR \-\-clean[\-all] [\fI-|file\fR]
13 Colorizes text read from standard input stream or file by using ANSI
14 escape sequences (and also vice versa, i.e. cleaning text from sequences)
15 and prints resulting output to the terminal.
17 When colorizing text, (foreground) and eventually (background) may be either
18 one of following color values: none, black, red, green, yellow, blue, magenta,
19 cyan, white, default or random. First character of color name in upper
20 case denotes increased intensity, whereas for lower case colors will be of
21 normal intensity. If "none" is chosen, no escape sequences will be emitted.
23 Color escape sequences are added per each line, hence colored lines can be
26 When de-colorizing text, \-\-clean omits color escape sequences which
27 were emitted by colorize (see NOTES for list), whereas \-\-clean\-all
28 omits all valid ones. If in doubt, consider using \-\-clean\-all.
31 .BR \-\-attr=\fIATTR1,ATTR2,...\fR
32 set attributes by name
34 Attributes: bold, underscore, blink, reverse and concealed.
38 clean text from color escape sequences emitted by colorize
41 clean text from all valid color escape sequences
43 .BR \-\-exclude\-random=\fICOLOR\fR
44 text color to be excluded when selecting a random foreground color
46 .BR \-\-omit\-color\-empty
47 omit printing color escape sequences for empty lines
50 show help screen and exit
52 .BR \-V ", " \-\-version
53 display version data and exit
57 user configuration file
60 If the aforementioned file exists, it is read, parsed and processed
61 prior to handling the command-line options. Command-line options
62 override configuration values, but are currently not capable of
63 unsetting them. If unsetting is desired, comment them out or remove
68 .B Sample configuration file
72 attr = bold,underscore
73 color = magenta # favorite one
74 exclude-random = black
75 omit-color-empty = yes
81 .B Configurable options and values
84 attr (values same as command-line option)
85 color (value same as command-line colors)
86 exclude-random (value same as command-line option)
87 omit-color-empty (yes/no)
95 Each line ought to start with a name of an option, followed by = and
96 an optional value. Leaving the value blank, unsets the option.
98 Whitespace is allowed before the option name, after the option name,
99 before the option value and after the option value.
101 Comments may be placed before or after the option is set. Everything
102 following the '#' sign is treated as being commented out.
106 The list of color escape sequence codes being emitted and omitted is
109 30-37,39 (foreground colors)
111 1-9;30-37,39 (foreground colors with attributes)
113 40-47,49 (background colors)
118 $ \fBcolorize green /etc/motd\fR
119 Print file /etc/motd with green as foreground color
121 $ \fBcolorize green/black /etc/motd\fR
122 Print file /etc/motd with green as foreground and black as background color
124 $ \fBcolorize green /etc/motd | colorize --clean\fR
125 Print input from stdin with color escape sequences omitted
127 $ \fBgit log -1 -p --color | colorize --clean-all\fR
128 Print input from stdin with all color escape sequences omitted
130 $ \fBcolorize --attr=bold green /etc/motd\fR
131 Print file /etc/motd with bold green as foreground color
133 Steven Schubiger <stsc@refcnt.org>