WXL
2025-12-19 da459f4addc08dede5b91f1f4e87e6c1c6d3c88e
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env node
// vim: set filetype=javascript:
 /* eslint-disable */
'use strict';
const program = require('commander');
const { reportCommand, initCommand, reportFromConfigCommand } = require('../dist/vue-i18n-extract.umd.js');
 
function increaseDynamic(dummyValue, previous) {
  return previous + 1;
}
 
program
  .command('init', { isDefault: false })
  .action(initCommand);
 
program
  .command('use-config', { isDefault: false })
  .action(reportFromConfigCommand);
 
program
  .command('report', { isDefault: true })
  .description('Create a report from a glob of your Vue.js source files and your language files.')
  .requiredOption(
    '-v, --vueFiles <vueFiles>',
    'The Vue.js file(s) you want to extract i18n strings from. It can be a path to a folder or to a file. It accepts glob patterns. (ex. *, ?, (pattern|pattern|pattern)',
  )
  .requiredOption(
    '-l, --languageFiles <languageFiles>',
    'The language file(s) you want to compare your Vue.js file(s) to. It can be a path to a folder or to a file. It accepts glob patterns (ex. *, ?, (pattern|pattern|pattern) ',
  )
  .option(
    '-o, --output <output>',
    'Use if you want to create a json file out of your report. (ex. -o output.json)',
  )
  .option(
    '-a, --add',
    'Use if you want to add missing keys into your language files.',
  )
  .option(
    '-r, --remove',
    'Use if you want to remove unused keys from your language files.',
  )
  .option(
    '-d, --dynamic',
    'Use if you want to ignore dynamic keys false-positive. Use it 2 times to get dynamic keys report',
    increaseDynamic,
    0
  )
  .option(
    '-ci --ci',
    'The process will exit with exitCode=1 if at least one translation-key is missing (useful expecially if it is part of a CI pipeline).',
  )
  .action(reportCommand);
 
 
program.parseAsync(process.argv);