No description
Find a file
Alexey Lebedeff 2ea1755cf2 Add compile target to Makefile
To make it usable with stock version of `erlang.mk`.

I'm trying to use `cf` from withing erlang.mk-based project, but it
fails to properly autopatch it. erlang.mk magic works properly when
Makefile contains some references to `rebar`.

Proper fix will be available within
https://github.com/ninenines/erlang.mk/issues/586

But currently it's far more easier to add single target to this project,
than to delve into shell script/make spaghetti =)
2016-08-02 14:06:37 +03:00
src Add link to GH, closes #1 2016-07-06 03:58:24 +02:00
.gitignore Use up to date termcap file 2015-10-19 02:35:25 +02:00
LICENSE first commit 2015-09-22 02:03:01 +02:00
Makefile Add compile target to Makefile 2016-08-02 14:06:37 +03:00
mk-termcap.escript Simplify color capability detection. 2015-10-19 04:20:00 +02:00
README.md Add underline and bold only codes 2015-09-22 17:08:46 +02:00
rebar.config Simplify color capability detection. 2015-10-19 04:20:00 +02:00
rebar.lock Simplify color capability detection. 2015-10-19 04:20:00 +02:00

cf

A helper library for termial colour printing extending the io:format syntax to add colours.

%% Effectively the same as io:format just takes the additional color
%% console text colour can be set by ~!**<colour>**.  ~#**<colour>**
%% will change the background. Both ~# only work with lowercase colours.
%% An uppercase letersindicate bold colours.
%%
%% The colour can be one of:
%%
%%   !   - resets the output
%%   ^   - bold (no colour change)
%%   __  - (two _) makes text underlined (no colour change)
%%   x,X - black
%%   r,R - red
%%   g,G - greeen
%%   y,Y - yellow
%%   b,B - blue
%%   m,M - magenta
%%   c,C - cyan
%%   w,W - white
%%
%%  The function will disable colours on non x term termials

Build

$ rebar3 compile

Usage

cf:format/[1,2] - an equivalent to io_lib:format/[1,2]. cf:print/[1,2] - an equivalent to io:format/[1,2].