提交 3eda4250 编写于 作者: B Benjamin Pasero

code-ps: rename renderer => window and change cli to "-s, --status" (for #39262)

上级 ec0250d2
...@@ -75,7 +75,7 @@ export function listProcesses(rootPid: number): Promise<ProcessItem> { ...@@ -75,7 +75,7 @@ export function listProcesses(rootPid: number): Promise<ProcessItem> {
return 'shared-process'; return 'shared-process';
} }
return `renderer`; return `window`;
} }
return matches[1]; return matches[1];
} }
......
...@@ -37,7 +37,7 @@ export function printDiagnostics(info: IMainProcessInfo): Promise<any> { ...@@ -37,7 +37,7 @@ export function printDiagnostics(info: IMainProcessInfo): Promise<any> {
return; return;
} }
console.log(`| Renderer (${window.title})`); console.log(`| Window (${window.title})`);
window.folders.forEach(folder => { window.folders.forEach(folder => {
console.log(`| Folder (${basename(folder)})`); console.log(`| Folder (${basename(folder)})`);
...@@ -156,7 +156,7 @@ function formatProcessItem(mapPidToWindowTitle: Map<number, string>, output: str ...@@ -156,7 +156,7 @@ function formatProcessItem(mapPidToWindowTitle: Map<number, string>, output: str
} else { } else {
name = `${repeat(' ', indent)} ${item.name}`; name = `${repeat(' ', indent)} ${item.name}`;
if (item.name === 'renderer') { if (item.name === 'window') {
name = `${name} (${mapPidToWindowTitle.get(item.pid)})`; name = `${name} (${mapPidToWindowTitle.get(item.pid)})`;
} }
} }
......
...@@ -102,9 +102,9 @@ function setupIPC(accessor: ServicesAccessor): TPromise<Server> { ...@@ -102,9 +102,9 @@ function setupIPC(accessor: ServicesAccessor): TPromise<Server> {
app.dock.show(); // dock might be hidden at this case due to a retry app.dock.show(); // dock might be hidden at this case due to a retry
} }
// Print --ps usage info // Print --status usage info
if (environmentService.args.ps) { if (environmentService.args.status) {
console.log('Warning: The --ps argument can only be used if Code is already running. Please run it again after Code has started.'); console.log('Warning: The --status argument can only be used if Code is already running. Please run it again after Code has started.');
} }
return server; return server;
...@@ -147,7 +147,7 @@ function setupIPC(accessor: ServicesAccessor): TPromise<Server> { ...@@ -147,7 +147,7 @@ function setupIPC(accessor: ServicesAccessor): TPromise<Server> {
const service = new LaunchChannelClient(channel); const service = new LaunchChannelClient(channel);
// Process Info // Process Info
if (environmentService.args.ps) { if (environmentService.args.status) {
return service.getMainProcessInfo().then(info => { return service.getMainProcessInfo().then(info => {
return printDiagnostics(info).then(() => TPromise.wrapError(new ExpectedError())); return printDiagnostics(info).then(() => TPromise.wrapError(new ExpectedError()));
}); });
......
...@@ -65,7 +65,7 @@ export async function main(argv: string[]): TPromise<any> { ...@@ -65,7 +65,7 @@ export async function main(argv: string[]): TPromise<any> {
let processCallbacks: ((child: ChildProcess) => Thenable<any>)[] = []; let processCallbacks: ((child: ChildProcess) => Thenable<any>)[] = [];
const verbose = args.verbose || args.ps; const verbose = args.verbose || args.status;
if (verbose) { if (verbose) {
env['ELECTRON_ENABLE_LOGGING'] = '1'; env['ELECTRON_ENABLE_LOGGING'] = '1';
......
...@@ -10,6 +10,7 @@ export interface ParsedArgs { ...@@ -10,6 +10,7 @@ export interface ParsedArgs {
_: string[]; _: string[];
help?: boolean; help?: boolean;
version?: boolean; version?: boolean;
status?: boolean;
wait?: boolean; wait?: boolean;
waitMarkerFilePath?: string; waitMarkerFilePath?: string;
diff?: boolean; diff?: boolean;
...@@ -48,7 +49,6 @@ export interface ParsedArgs { ...@@ -48,7 +49,6 @@ export interface ParsedArgs {
'disable-updates'?: string; 'disable-updates'?: string;
'disable-crash-reporter'?: string; 'disable-crash-reporter'?: string;
'skip-add-to-recently-opened'?: boolean; 'skip-add-to-recently-opened'?: boolean;
'ps'?: boolean;
} }
export const IEnvironmentService = createDecorator<IEnvironmentService>('environmentService'); export const IEnvironmentService = createDecorator<IEnvironmentService>('environmentService');
......
...@@ -53,7 +53,7 @@ const options: minimist.Opts = { ...@@ -53,7 +53,7 @@ const options: minimist.Opts = {
'disable-updates', 'disable-updates',
'disable-crash-reporter', 'disable-crash-reporter',
'skip-add-to-recently-opened', 'skip-add-to-recently-opened',
'ps' 'status'
], ],
alias: { alias: {
add: 'a', add: 'a',
...@@ -62,6 +62,7 @@ const options: minimist.Opts = { ...@@ -62,6 +62,7 @@ const options: minimist.Opts = {
wait: 'w', wait: 'w',
diff: 'd', diff: 'd',
goto: 'g', goto: 'g',
status: 's',
'new-window': 'n', 'new-window': 'n',
'reuse-window': 'r', 'reuse-window': 'r',
performance: 'p', performance: 'p',
...@@ -147,7 +148,7 @@ export const optionsHelp: { [name: string]: string; } = { ...@@ -147,7 +148,7 @@ export const optionsHelp: { [name: string]: string; } = {
'--enable-proposed-api <extension-id>': localize('experimentalApis', "Enables proposed api features for an extension."), '--enable-proposed-api <extension-id>': localize('experimentalApis', "Enables proposed api features for an extension."),
'--disable-extensions': localize('disableExtensions', "Disable all installed extensions."), '--disable-extensions': localize('disableExtensions', "Disable all installed extensions."),
'--disable-gpu': localize('disableGPU', "Disable GPU hardware acceleration."), '--disable-gpu': localize('disableGPU', "Disable GPU hardware acceleration."),
'--ps': localize('ps', "Print process usage and diagnostics information."), '-s, --status': localize('status', "Print process usage and diagnostics information."),
'-v, --version': localize('version', "Print version."), '-v, --version': localize('version', "Print version."),
'-h, --help': localize('help', "Print usage.") '-h, --help': localize('help', "Print usage.")
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册