mermaid/bin/mermaid.js

27 lines
559 B
JavaScript
Raw Normal View History

2014-12-20 17:18:38 -08:00
#!/usr/bin/env node
2017-04-13 21:53:23 +08:00
// var fs = require('fs')
var chalk = require('chalk')
var error = chalk.bold.red
var cli = require('../lib/cli.js')
var lib = require('../lib')
2014-12-20 17:18:38 -08:00
2017-04-11 22:14:25 +08:00
cli.parse(process.argv.slice(2), function (err, message, options) {
2014-12-20 17:18:38 -08:00
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
2017-04-11 22:14:25 +08:00
} else if (message) {
2014-12-20 17:18:38 -08:00
console.log(message)
return
}
lib.process(options.files, options, process.exit)
2017-04-11 22:14:25 +08:00
})