UNPKG

jianying

Version:

A CLI Tools for parse JianyingPro Projects.

28 lines (21 loc) 628 B
#!/usr/bin/env node const cac = require('cac') const jianying = require('..') const { name, version } = require('../package.json') // Unified error handling /* istanbul ignore next */ const onError = err => { console.error(err.message) process.exit(1) } process.on('uncaughtException', onError) process.on('unhandledRejection', onError) const cli = cac(name) // TODO: Implement module cli cli .command('srt <input>', 'Extract the caption information in the project as SRT file') .example(` $ ${name} srt path/to/template.tmp`) .action(input => { jianying.srt(input) }) cli.help().version(version).parse()