2014-12-20 17:18:38 -08:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
|
|
|
var fs = require('fs')
|
|
|
|
, chalk = require('chalk')
|
|
|
|
, error = chalk.bold.red
|
|
|
|
, cli = require('../lib/cli.js')
|
2016-05-29 19:18:04 +02:00
|
|
|
, lib = require('../lib');
|
2014-12-20 17:18:38 -08:00
|
|
|
|
|
|
|
cli.parse(process.argv.slice(2), function(err, message, options) {
|
|
|
|
if (err) {
|
|
|
|
console.error(
|
|
|
|
error('\nYou had errors in your syntax. Use --help for further information.')
|
|
|
|
)
|
|
|
|
err.forEach(function (e) {
|
|
|
|
console.error(e.message)
|
|
|
|
})
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
else if (message) {
|
|
|
|
console.log(message)
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2015-11-05 15:50:59 -05:00
|
|
|
lib.process(options.files, options, process.exit)
|
2016-05-29 19:18:04 +02:00
|
|
|
});
|