felixSchl / neodoc

Beautiful, hand-crafted commandline interfaces for node.js
https://felixschl.github.io/neodoc
MIT License
227 stars 9 forks source link

Ignore colors in the parser #70

Closed matthewmueller closed 8 years ago

matthewmueller commented 8 years ago

First of all this is a really excellent library. I've been waiting awhile for a proper docopt parser for JS. Great work!

One thing I did run into was that it's not possible to fully color some of the key commands. For example, if I want to color Usage:

This works

${chalk.blue('I. Usage')}:

This doesn't work:

${chalk.blue('I. Usage:')}

It's quite minor, but I'd love for this parser to just ignore the color codes altogether.

felixSchl commented 8 years ago

Wow yeah, good find and thanks for reporting. I can see how that would be an issue. Won't take long to fix I think.

felixSchl commented 8 years ago

I've got a fix implemented. These tests show what is now allowed: https://github.com/felixSchl/neodoc/commit/ffa7424513efc089880a26d337a3ad13985990de#diff-846cfe57c9231ae390e1f48b1aeaacb2R913. That should cover your usecase but if you'd like to give me a fixture we can add that to the testbed and verify.

felixSchl commented 8 years ago

Github was a bit eager to close this because of the subject line. The fix is on development now and will be part of the next release. It's working fine for the fixture you have given me for #71 which includes colors as well. I updated the test suite accordingly. I think once we have #71 sorted out, I'll do a patch release. I've got some other fixes pending as well.