-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathcli.js
22 lines (18 loc) · 884 Bytes
/
cli.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env node
import program from 'commander';
program
.command('json2pot <srcPatterns>')
.option('-o, --output <path>', 'The output pathname of `.pot` file to be translated')
.option('-k, --message-key [key]', 'Translation message ID key (default key is `defaultMessage`)')
.option('-v, --message-value [key]', 'Translation message value key (default is to omit this)')
.action(require('./extractAndWritePOTFromMessagesSync'));
program
.command('po2json <srcPatterns>')
.option(
'-m, --messages-pattern <path>',
'The pattern of *json* files extracted from *babel-plugin-react-intl*',
)
.option('-o, --output <path>', 'The output pathname of a file / directory')
.option('-k, --message-key [key]', 'Translation message ID key (default key is `defaultMessage`)')
.action(require('./filterPOAndWriteTranslateSync'));
program.parse(process.argv);