]> git.refcnt.org Git - colorize.git/blob - README.cgit
Omit declaration of optind/optarg
[colorize.git] / README.cgit
1 <pre>
2 colorize
3 ========
4
5 Description
6 -----------
7 Colorize aims at being a small, independent and handy command-line
8 text colorizing tool. It emits ANSI escape sequences in order to
9 color lines of text; also, sequences emitted by colorize or foreign
10 programs may be cleared.
11
12 The main code is written in C (c89 mostly), whereas the test script
13 consists of Perl code.
14
15 Colorize is known to build and test successfully on Linux and
16 Net/Open/MirBSD. Other platforms are untested, so be prepared for
17 it to eventually not work as expected there.
18
19 Requirements
20 ------------
21 gcc
22 make
23 perl
24 valgrind (optional)
25
26 Build instructions
27 ------------------
28 Issue `make' to build colorize.
29
30 Once completed, run the tests with `make check'.
31
32 Then you should most likely have a working binary.
33
34 Next, install it with `make install' (may require elevated
35 user permissions).
36
37 Finally, clean up the working directory through `make clean'.
38
39 Customizing instructions
40 ------------------------
41 The default character ('/') which separates the foreground
42 from the background color may be redefined:
43
44 `make FLAGS=-DCOLOR_SEP_CHAR_COLON' -&gt; defines as ':'
45 `make FLAGS=-DCOLOR_SEP_CHAR_SLASH' -&gt; defines as '/'
46
47 Debugging instructions
48 ----------------------
49 For the sake of completeness, colorize can be also built with
50 debugging output by issuing `make FLAGS=-DDEBUG'. The intention
51 is to provide some memory allocation diagnostics (and might be
52 extended in future). Usually, a debugging build is not required.
53
54 Furthermore, tests can be run through valgrind by issuing, for
55 example, `make check_valgrind 2&gt;&1 | tee valgrind.out'. The
56 file provided here for the `tee' invocation will be populated
57 with the captured output from both standard output and error
58 stream.
59
60 Configuration File
61 ------------------
62 A user configuration file may be populated with options and
63 according values. See man page source file `colorize.1' for
64 details.
65
66 Documentation
67 -------------
68 See man page source file: colorize.1.
69
70 Usage example
71 -------------
72 In ~/.bashrc:
73
74 | ls_color() {
75 | ls "$@" | colorize green -
76 | }
77 | alias ls=ls_color
78
79 This excerpt defines an alias which will set the color being
80 printed for literal ls invocations to green.
81
82 Afterword
83 ---------
84 Let me know, if you have ideas, bug reports, patches, etc.
85
86 Author
87 ------
88 Steven Schubiger &lt;stsc@refcnt.org&gt;
89
90 </pre>