All files cli.ts

0% Statements 0/16
0% Branches 0/10
100% Functions 0/0
0% Lines 0/16

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37                                                                         
#!/usr/bin/env node
 
import program = require('commander');
import run from './index';
import { IOptions } from './index';
 
program
  .option('-e, --entry [path]', '<path|glob> …')
  .option('-d, --dataDir [path]', 'Output directory for data.')
  .option('-l, --localesDir [path]', 'Output directory for locales.')
  .option('-f, --localesFile [name]', 'Filename for locales.')
  .option('-w, --watch', 'watch mode')
  .option('-v, --verbose', 'output extra debugging');
 
program.parse(process.argv);
 
if (program.verbose) {
  console.log(program.opts());
}
 
const options: IOptions = {};
 
if (program.entry) {
  options.source = program.entry;
}
if (program.dataDir) {
  options.dataDir = program.dataDir;
}
if (program.localesDir) {
  options.localesDir = program.localesDir;
}
if (program.localesFile) {
  options.localesFile = program.localesFile;
}
 
run(options);