mermaid/bin/mermaid.js

25 lines
515 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 chalk = require('chalk')
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(
2017-04-16 18:27:48 +08:00
chalk.bold.red('\nYou had errors in your syntax. Use --help for further information.')
2014-12-20 17:18:38 -08:00
)
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
})