The standalone usage is a bit bizarre, because it tries to produce HTML by default and write the output to a file named infile.html. To produce colored plain text on standard output, use something like
source-highlight -fesc -oSTDOUT FILENAME
To get the most out of this, integrate it with the less pager program, so all the files you look at are automatically colored. Create a file .lessfilter in your home directory with the following contents:
#!/bin/shand make this file executable. Be sure to redirect the error output away as shown, so that you don't get annoying messages when source-highlight complains in case it doesn't know the format of the file. Then put the following in your shell startup file (.bashrc or .zshrc):
source-highlight -fesc -oSTDOUT "$1" 2>/dev/null
export LESS="-R"The first line makes sure that less will show colors, and the second line sets things up so that the .lessfilter file is invoked.
That's it. It recognizes the file type by the file name extension, so try anything like
less somefile.cto see the colors. It won't work when less is at the end of a pipe; I have some ideas on how to work around that, which I will post here later.