Ever wondered why the output of your favourite UNIX/Linux commands is still displayed in black-and-white after all these years?
Ever had to search back through your scroll-buffer in search of gcc errors and salient information to tell you what went wrong with your program's execution?
acoc is a regular expression based colour formatter for programs that display output on the command-line. It works as a wrapper around the target program, executing it and capturing the stdout stream. Optionally, stderr can be redirected to stdout, so that it, too, can be manipulated.
acoc then applies matching rules to patterns in the output and applies colour sets to those matches.
Changes in 0.7.1:
SIGPIPE is now caught while exiting.
Changes in 0.7.0:
It is now possible to use regular expressions in program specs, such as [ps -.*(e.*f|f.*e)].
A bug was fixed, whereby having /usr/acoc/bin in one's $PATH could cause acoc to be invoked multiple times.
Changes in 0.6.0:
A user-definable config file may now be specified in $ACOCRC.
Some new colouring specs were added for netstat, nmap and a few other commands.
Changes in 0.5.2:
Command line glob arguments presented problems if the resulting expansion contained single quotes. This has been fixed.
The ARGV array is now expanded when passing it to the colour method.
A superfluous debugging statement has been removed.
Changes in 0.5.1:
SIGCHLD was not being trapped, which was causing errors on some systems, but not on others. This has now been fixed.
Changes in 0.5.0:
The exit status of the wrapped child program was not being propagated back through acoc, resulting in a lack of operational transparency.
Changes in 0.4.7:
A bug was fixed whereby the /r flag would work only on the first program spec on which it appeared.
Changes in 0.4.6:
A bug has been fixed that caused signals not to be passed to child processes attached to a pseudo-tty. Additionally, ping is now allocated a pseudo-tty, as its behaviour changes if stdout is not a tty.
Changes in 0.4.5:
A bug in the signal handling was fixed.
Changes in 0.4.4:
Running under 1.6.x produced a parse error, as rescue is not allowed as a statement modifier in that version.
Changes in 0.4.3:
This version goes back to using the optional Ruby/TPty library by Masahiro Tomita, as the standard PTY module proved unreliable.
A minor bug in the signal handler was also fixed.
Changes in 0.4.2:
Colouring is no longer performed if the $ACOC environment variable is set to 'none'. This provides a quick way to disable acoc on a per-command basis.
The sample colour configs in /etc/acoc.conf were improved and minor fixes were made.
Ruby's standard PTY module is now used, rather than Ruby/TPty. I didn't even know that Ruby had a built-in PTY module until I was looking up the readline module in 'Ruby in a Nutshell' and happened to notice it on the same page :-)
Changes in 0.4.1:
A bug that caused arguments with white space to be expanded to multiple arguments has been fixed.
Changes in 0.4.0:
Invocation-specific colouring rules are now possible. For example, you can now define separate rules for 'ps ax' than for 'ps -ef'. Similarly, 'rpm -b' can be coloured differently to 'rpm -q'.
The configuration file has been updated to make use of this new feature.
Changes in 0.3.0:
A new program flag, /p, requests allocation of a pseudo-terminal through which to run the target program (this requires the optional Ruby/TPty library by Masahiro Tomita to be installed).
ls(1) is now configured to get a pseudo-terminal, if available, as it behaves differently if its stdout is not connected to a tty.
Target programs are now simply exec'ed if their configuration stanza contains no rules.
The code was cleaned up and made more object-oriented.
Changes in 0.2.6:
A new program flag, /r, removes all previous matching rules for a given program. This allows undesirable settings in the global configuration file to be overridden in the user configuration file. Bugs in the pattern-matching rules for ls have been fixed. Programs are now simply exec()ed if their configuration stanzas are empty.
Changes in 0.2.5:
By default, colouring will now not take place if stdout is not a tty. A new program flag has been added to override this behaviour. /t on a program_spec allows colouring to take place even when stdout is not a tty.
Changes in 0.2.1:
This version includes new config sections for tcpdump, ldd, nm, strace, ltrace, id and ls.
The diff config now also applies to rcsdiff, while the make config now also applies to gmake.
Finally, the tarball now includes Term::ANSIColor for lazy people. There's no need to install this separately.
Changes in 0.2.0:
A SIGPIPE while printing is now caught and handled.
If the program is called on a non-existent program, the error now goes go to stderr, not stdout.
Program flags are now cumulative with each stanza for programs that have multiple configuration stanzas.
Improvements were made to the matching rules. For example, the diff rules now handle standard and context format output, and the rpmbuild rules were broken out into gcc and make rules.