(args: string[])
| 114 | } |
| 115 | |
| 116 | export function readNgcCommandLineAndConfiguration(args: string[]): NgcParsedConfiguration { |
| 117 | const options: api.CompilerOptions = {}; |
| 118 | const parsedArgs = yargs(args) |
| 119 | .parserConfiguration({'strip-aliased': true}) |
| 120 | .option('i18nFile', {type: 'string'}) |
| 121 | .option('i18nFormat', {type: 'string'}) |
| 122 | .option('locale', {type: 'string'}) |
| 123 | .option('missingTranslation', {type: 'string', choices: ['error', 'warning', 'ignore']}) |
| 124 | .option('outFile', {type: 'string'}) |
| 125 | .option('watch', {type: 'boolean', alias: ['w']}) |
| 126 | .parseSync(); |
| 127 | |
| 128 | if (parsedArgs.i18nFile) options.i18nInFile = parsedArgs.i18nFile; |
| 129 | if (parsedArgs.i18nFormat) options.i18nInFormat = parsedArgs.i18nFormat; |
| 130 | if (parsedArgs.locale) options.i18nInLocale = parsedArgs.locale; |
| 131 | if (parsedArgs.missingTranslation) |
| 132 | options.i18nInMissingTranslations = |
| 133 | parsedArgs.missingTranslation as api.CompilerOptions['i18nInMissingTranslations']; |
| 134 | |
| 135 | const config = readCommandLineAndConfiguration(args, options, [ |
| 136 | 'i18nFile', |
| 137 | 'i18nFormat', |
| 138 | 'locale', |
| 139 | 'missingTranslation', |
| 140 | 'watch', |
| 141 | ]); |
| 142 | return {...config, watch: parsedArgs.watch}; |
| 143 | } |
| 144 | |
| 145 | export function readCommandLineAndConfiguration( |
| 146 | args: string[], |
no test coverage detected
searching dependent graphs…