MCPcopy
hub / github.com/compiler-explorer/compiler-explorer / parseArgsToAppArguments

Function parseArgsToAppArguments

lib/app/cli.ts:222–245  ·  view source on GitHub ↗
(argv: string[])

Source from the content-addressed store, hash-verified

220 * @returns Application arguments
221 */
222export function parseArgsToAppArguments(argv: string[]): AppArguments {
223 const options = parseCommandLine(argv);
224 const isWsl = detectWsl();
225
226 const distPath = utils.resolvePathFromAppRoot('.');
227 logger.debug(`Distpath=${distPath}`);
228
229 const gitReleaseName = getGitReleaseName(distPath, options.dist === true);
230 const releaseBuildNumber = getReleaseBuildNumber(distPath, options.dist === true);
231
232 const appArgs = convertOptionsToAppArguments(options, gitReleaseName, releaseBuildNumber, isWsl);
233
234 if (options.version) {
235 // We can't use the `--version` support in Commander, as we need to parse the args
236 // to find the directory for the git release and whatnot.
237 logger.info('Compiler Explorer version info:');
238 logger.info(` git release ${appArgs.gitReleaseName}`);
239 logger.info(` release build ${appArgs.releaseBuildNumber}`);
240 logger.info('Exiting');
241 process.exit(0);
242 }
243
244 return appArgs;
245}

Callers 2

app.tsFile · 0.85
cli-tests.tsFile · 0.85

Calls 6

parseCommandLineFunction · 0.85
detectWslFunction · 0.85
getGitReleaseNameFunction · 0.85
getReleaseBuildNumberFunction · 0.85
exitMethod · 0.80

Tested by

no test coverage detected