MCPcopy Index your code
hub / github.com/angular/angular / readNgcCommandLineAndConfiguration

Function readNgcCommandLineAndConfiguration

packages/compiler-cli/src/main.ts:116–143  ·  view source on GitHub ↗
(args: string[])

Source from the content-addressed store, hash-verified

114}
115
116export 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
145export function readCommandLineAndConfiguration(
146 args: string[],

Callers 8

driveDiagnosticsAsyncMethod · 0.90
driveIndexerMethod · 0.90
driveDocsExtractionMethod · 0.90
driveHmrMethod · 0.90
mainFunction · 0.85
mainDiagnosticsForTestFunction · 0.85

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…