Skip to content

Commit 82a9052

Browse files
committed
more cli args cleanup
1 parent af53133 commit 82a9052

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

src/vs/platform/environment/common/environment.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,13 @@ export interface ParsedArgs {
7171
'driver-verbose'?: boolean;
7272
remote?: string;
7373
'disable-user-env-probe'?: boolean;
74-
'enable-remote-auto-shutdown'?: boolean;
7574
'disable-inspect'?: boolean;
7675
'force'?: boolean;
77-
'gitCredential'?: string;
76+
7877
// node flags
7978
'js-flags'?: string;
8079
'disable-gpu'?: boolean;
8180
'nolazy'?: boolean;
82-
83-
// Web flags
84-
'web-user-data-dir'?: string;
8581
}
8682

8783
export const IEnvironmentService = createDecorator<IEnvironmentService>('environmentService');

src/vs/platform/environment/node/argv.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,14 @@ type OptionTypeName<T> =
4040
T extends undefined ? 'undefined' :
4141
'unknown';
4242

43-
export const OPTIONS: OptionDescriptions<ParsedArgs> = {
43+
export const OPTIONS: OptionDescriptions<Required<ParsedArgs>> = {
4444
'diff': { type: 'boolean', cat: 'o', alias: 'd', args: ['file', 'file'], description: localize('diff', "Compare two files with each other.") },
4545
'add': { type: 'boolean', cat: 'o', alias: 'a', args: 'folder', description: localize('add', "Add folder(s) to the last active window.") },
4646
'goto': { type: 'boolean', cat: 'o', alias: 'g', args: 'file:line[:character]', description: localize('goto', "Open a file at the path on the specified line and character position.") },
4747
'new-window': { type: 'boolean', cat: 'o', alias: 'n', description: localize('newWindow', "Force to open a new window.") },
4848
'reuse-window': { type: 'boolean', cat: 'o', alias: 'r', description: localize('reuseWindow', "Force to open a file or folder in an already opened window.") },
4949
'wait': { type: 'boolean', cat: 'o', alias: 'w', description: localize('wait', "Wait for the files to be closed before returning.") },
50+
'waitMarkerFilePath': { type: 'string' },
5051
'locale': { type: 'string', cat: 'o', args: 'locale', description: localize('locale', "The locale to use (e.g. en-US or zh-TW).") },
5152
'user-data-dir': { type: 'string', cat: 'o', args: 'dir', description: localize('userDataDir', "Specifies the directory that user data is kept in. Can be used to open multiple distinct instances of Code.") },
5253
'version': { type: 'boolean', cat: 'o', alias: 'v', description: localize('version', "Print version.") },
@@ -56,6 +57,7 @@ export const OPTIONS: OptionDescriptions<ParsedArgs> = {
5657
'file-uri': { type: 'string[]', cat: 'o', args: 'uri', description: localize('fileUri', "Opens a window with given file uri(s)") },
5758

5859
'extensions-dir': { type: 'string', deprecates: 'extensionHomePath', cat: 'e', args: 'dir', description: localize('extensionHomePath', "Set the root path for extensions.") },
60+
'builtin-extensions-dir': { type: 'string' },
5961
'list-extensions': { type: 'boolean', cat: 'e', description: localize('listExtensions', "List the installed extensions.") },
6062
'show-versions': { type: 'boolean', cat: 'e', description: localize('showVersions', "Show versions of installed extensions, when using --list-extension.") },
6163
'category': { type: 'string', cat: 'e', description: localize('category', "Filters installed extensions by provided category, when using --list-extension.") },
@@ -67,8 +69,8 @@ export const OPTIONS: OptionDescriptions<ParsedArgs> = {
6769
'log': { type: 'string', cat: 't', args: 'level', description: localize('log', "Log level to use. Default is 'info'. Allowed values are 'critical', 'error', 'warn', 'info', 'debug', 'trace', 'off'.") },
6870
'status': { type: 'boolean', alias: 's', cat: 't', description: localize('status', "Print process usage and diagnostics information.") },
6971
'prof-startup': { type: 'boolean', cat: 't', description: localize('prof-startup', "Run CPU profiler during startup") },
70-
'prof-startup-prefix': { type: 'string' },
7172
'prof-append-timers': { type: 'string' },
73+
'prof-startup-prefix': { type: 'string' },
7274
'disable-extensions': { type: 'boolean', deprecates: 'disableExtensions', cat: 't', description: localize('disableExtensions', "Disable all installed extensions.") },
7375
'disable-extension': { type: 'string[]', cat: 't', args: 'extension-id', description: localize('disableExtension', "Disable an extension.") },
7476

@@ -96,19 +98,22 @@ export const OPTIONS: OptionDescriptions<ParsedArgs> = {
9698
'disable-telemetry': { type: 'boolean' },
9799
'disable-updates': { type: 'boolean' },
98100
'disable-crash-reporter': { type: 'boolean' },
101+
'disable-user-env-probe': { type: 'boolean' },
99102
'skip-add-to-recently-opened': { type: 'boolean' },
100103
'unity-launch': { type: 'boolean' },
101104
'open-url': { type: 'boolean' },
102105
'file-write': { type: 'boolean' },
103106
'file-chmod': { type: 'boolean' },
104107
'driver-verbose': { type: 'boolean' },
105108
'force': { type: 'boolean' },
109+
'trace': { type: 'boolean' },
106110
'trace-category-filter': { type: 'string' },
107111
'trace-options': { type: 'string' },
108112
'disable-inspect': { type: 'boolean' },
109113

110114
'js-flags': { type: 'string' }, // chrome js flags
111115
'nolazy': { type: 'boolean' }, // node inspect
116+
'_urls': { type: 'string[]' },
112117

113118
_: { type: 'string[]' } // main arguments
114119
};
@@ -128,6 +133,10 @@ export function parseArgs<T>(args: string[], options: OptionDescriptions<T>, err
128133
const string: string[] = [];
129134
const boolean: string[] = [];
130135
for (let optionId in options) {
136+
if (optionId[0] === '_') {
137+
continue;
138+
}
139+
131140
const o = options[optionId];
132141
if (o.alias) {
133142
alias[optionId] = o.alias;

src/vs/platform/environment/node/environmentService.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ export class EnvironmentService implements IEnvironmentService {
104104
return parseUserDataDir(this._args, process);
105105
}
106106

107-
@memoize
108-
get webUserDataHome(): URI { return URI.file(parsePathArg(this._args['web-user-data-dir'], process) || this.userDataPath); }
109107

110108
get appNameLong(): string { return product.nameLong; }
111109

@@ -285,7 +283,7 @@ function parseDebugPort(debugArg: string | undefined, debugBrkArg: string | unde
285283
return { port, break: brk, debugId };
286284
}
287285

288-
function parsePathArg(arg: string | undefined, process: NodeJS.Process): string | undefined {
286+
export function parsePathArg(arg: string | undefined, process: NodeJS.Process): string | undefined {
289287
if (!arg) {
290288
return undefined;
291289
}

0 commit comments

Comments
 (0)