PrePAN

Sign in to PrePAN

Profile

User's Modules

App::ansicolumn ANSI sequence aware column command

I made this command to demonstrate Text::ANSI::Printf module, but it is getting to be more interesting tool.

EXAMPLE

column(1) compatible usage

$ ls -1 --color=always /usr/bin | ansicolumn

$ (printf "PERM LINKS OWNER GROUP SIZE MONTH DAY HH:MM/YEAR NAME\n" ; ls --color=always -l | sed 1d) | ansicolumn -t

Show DOCX document in 3up format

$ cpanm App::optex::textconv
$ optex -Mtextconv ansicolumn -DPC3 foo.docx | less

Show highlighted source code in 2up format

$ source-highlight -f esc -i lib/App/ansicolumn.pm | ansicolumn -PC2 | less

INSTALL

$ cpanm https://github.com/kaz-utashiro/App-ansicolumn.git

kaz-utashiro@github 0 comments

Text::ANSI::Printf printf function for string with ANSI sequence

Text::ANSI::Printf is a almost-printf-compatible library with a capability of handling string with ANSI terminal sequences, as well as multi-byte wide characters.

This is just a quick hack using existing modules, Text::VisualPrintf and Text::ANSI::Fold::Util. Not tuned for performance. Most of complicated work is done in Text::ANSI::Fold module.

INSTALL: cpanm https://github.com/kaz-utashiro/Text-ANSI-Printf.git

kaz-utashiro@github 6 comments