millermedeiros/esformatter — pull request #40 by piuccio (2013-05-10 08:51:45+00:00)
Title: Improve command line binary

Give the possibility to specify from the command line a file(s) to be formatted with optional configuration.

As written in the `README` it's now possible to use
````sh
# format "test.js" and output result to stdout
esformatter test.js
# format "test.js" using options in "options.json" and output result to stdout
esformatter --config options.json test.js
# process "test.js" and writes to "test.out.js"
esformatter test.js > test.out.js
````

This is an addition to the previos behavior that still works as before.

It is actaully possible to format multiple files at the same time, but I don't see the advantage of doing it

````sh
esformatter file1.js file2.js file3.js
# equivalent to cat file1.js file2.js file3.js | esformatter
````

Of course you can use

````sh
# Usage information
esformatter --help
esformatter -h

# Version number
esformatter --version
esformatter -v
````

I've added also unit tests to verify that the command line does its job and modified slightly the helpers utility to work on windows as well (damn carriage returns).

This should close #25, #26 and #27

Thanks for the project, I love it!

Please let me know if you want me to change the formatting or follow some different coding styles :wink: