Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/test/simulation/workbench/initArgs.ts
13394 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import minimist from 'minimist';
7
8
export type InitArgs = {
9
runOutputDirName?: string;
10
grep?: string;
11
};
12
13
/**
14
* See {@link script/electron/simulationWorkbenchMain.js} for CLI args available.
15
*/
16
export function parseInitEventArgs(processArgv: string[]): InitArgs | undefined {
17
18
const parsedArgs = minimist(processArgv);
19
20
let runOutputDirName: string | undefined;
21
if ('run-dir' in parsedArgs) {
22
runOutputDirName = parsedArgs['run-dir'];
23
}
24
25
let grep: string | undefined;
26
if ('grep' in parsedArgs) {
27
grep = parsedArgs['grep'];
28
}
29
30
if (runOutputDirName !== undefined || grep !== undefined) {
31
return { runOutputDirName, grep };
32
}
33
}
34
35