Pending

User tests: Successful: Unsuccessful:

avatar elkuku
elkuku
11 May 2013

Recently a new feature has been added to the framework that allows CLI applications to display colorful output on ANSI enabled terminals. So I thought we might see how it looks and feels ;)

Colors

ANSI color codes are supported in most (if not all) *nix style terminals.
To test this feature I grabbed a VM with Windows XP, installed git for Windows and GitHub (both include terminals) but neither them nor the standard Windows thingy supported ANSI colors.
Then I installed Cygwin (which is a good choice anyway), and got the following output:
win-colors1

Progress Bar

Since we have some long runng operations (currently ~10 min pulling the CMS issues on my slow i-net), I thought we might use some "high class" progress bar.

The progress bar is not part of the repo and has to be installed using composer from elkuku/console-progressbar (which is a fork of PEAR/Console_ProgressBar with a facelifting ;)
I haven't tried that on windows, but it might work on cygwin...
progressbar3

Unsupported...

If your terminal does not support ANSI control codes you may see something like this:
win-colors-fail

Turn it off !

To suppress color ouput for a single command use the --nocolors switch.
Example:
tracker.php retrieve issues --nocolors

To turn the features off permanently edit etc/config.json and set the values for the undesired features from 1 to 0.


Since most of the code in this PR has been used to actually test this feature before submitting it to the framework, I thought I could give this here back too.

If you have any strong feelings against this, please raise your voice here and now or I am going to merge it ;)

avatar elkuku elkuku - open - 11 May 2013
avatar elkuku elkuku - open - 11 May 2013
avatar mbabker
mbabker - comment - 11 May 2013

I was wondering how long it would be before that stuff got used here ;-)

On Saturday, May 11, 2013, Nikolai Plath wrote:

Recently a new feature has been added to the framework that allows CLI
applications to display colorful output on ANSI enabled terminals. Si I
thought we might see how it looks and feels ;)
Colors

ANSI color codes are supported in most (if not all) *nix style terminals.
To test this feature I grabbed a VM with Windows XP, installed git for
Windows and GitHub (both include terminals) but neither them nor the
standard Windows thingy supported ANSI colors.
Then I installed Cygwin http://www.cygwin.com/ (which is a good choice
anyway), and got the following output:
[image: win-colors1]https://f.cloud.github.com/assets/33978/491726/2c5ff9b4-ba54-11e2-80eb-76a29914d58a.png
Progress Bar

Since we have some long runng operations (currently ~10 min pulling the
CMS issues on my slow i-net), I thought we might use some "high class"
progress bar.

The progress bar is not part of the repo and has to be installed using
composer from elkuku/console-progressbarhttps://packagist.org/packages/elkuku/console-progressbar(which is a fork of
PEAR/Console_ProgressBar http://pear.php.net/package/Console_ProgressBarwith a facelifting ;)
I haven't tried that on windows, but it might work on cygwin...
[image: progressbar3]https://f.cloud.github.com/assets/33978/491733/a36ce152-ba54-11e2-8c06-179b6a379876.png
Unsupported...

If your terminal does not support ANSI control codes you may see something
like this:
[image: win-colors-fail]https://f.cloud.github.com/assets/33978/491728/57cc233e-ba54-11e2-9c6b-154ad99488fd.png
Turn it off !

To suppress color ouput for a single command use the --nocolors switch.
Example:
tracker.php retrieve issues --nocolors

To turn the features off permanently edit etc/config.json and set the

values for the undesired features from 1 to 0.

Since most of the code in this PR has been used to actually test this
feature before submitting it to the framework, I thought I could give this
here back too.

If you have any strong feelings against this, please raise your voice here

and now or I am going to merge it ;)

You can merge this Pull Request by running

git pull https://github.com/elkuku/jissues cli-colors

Or view, comment on, or merge it at:

#104
Commit Summary

  • Add colors amd a progress bar to the CLI application

File Changes

Patch Links:

avatar elkuku
elkuku - comment - 11 May 2013

This is a "must have" for every modern CLI application :P

avatar - close - 11 May 2013
avatar mbabker mbabker - reference | cfb2326 - 11 May 13
avatar mbabker mbabker - merge - 11 May 2013
avatar mbabker mbabker - close - 11 May 2013
avatar elkuku elkuku - head_ref_deleted - 11 May 2013

Add a Comment

Login with GitHub to post a comment