When is it appropriate to use colour in a command-line application?

Posted by marcoms on Programmers See other posts from Programmers or by marcoms
Published on 2013-11-01T18:39:55Z Indexed on 2013/11/01 22:10 UTC
Read the original article Hit count: 208

Currently I have a command-line application in C called btcwatch. It has a -C option that it can receive as an argument that compares the current price of Bitcoin with a price that was stored beforehand with -S. Example output with this option is:

$ btcwatch -vC  # -v = verbose
buy: UP $ 32.000000 USD (100.000000 -> 132.000000)
sell: UP $ 16.000000 USD (100.000000 -> 116.000000)

The dilemma is whether to use colour for the UP or DOWN string (green and red, respectively). Most command-line applications I know of (apart from git) stay away from colour in their output. In my desire for btcwatch to look and be quite "standard" (use of getopt, Makefiles, etc), I'm not sure if colour would look out of place in this situation.

© Programmers or respective owner

Related posts about coding-standards

Related posts about command-line