mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
25 lines
515 B
JavaScript
Executable File
25 lines
515 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
var chalk = require('chalk')
|
|
var cli = require('../lib/cli.js')
|
|
var lib = require('../lib')
|
|
|
|
cli.parse(process.argv.slice(2), function (err, message, options) {
|
|
if (err) {
|
|
console.error(
|
|
chalk.bold.red('\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
|
|
}
|
|
|
|
lib.process(options.files, options, process.exit)
|
|
})
|