mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-03 23:06:49 +01:00
@@ -122,8 +122,6 @@ export function parseArgs(args: string[]): ParsedArgs {
|
||||
return minimist(args, options) as ParsedArgs;
|
||||
}
|
||||
|
||||
const executable = 'code' + (os.platform() === 'win32' ? '.exe' : '');
|
||||
|
||||
export const optionsHelp: { [name: string]: string; } = {
|
||||
'-d, --diff': localize('diff', "Open a diff editor. Requires to pass two file paths as arguments."),
|
||||
'--disable-extensions': localize('disableExtensions', "Disable all installed extensions."),
|
||||
@@ -177,13 +175,14 @@ function wrapText(text: string, columns: number) : string[] {
|
||||
return lines;
|
||||
}
|
||||
|
||||
export function buildHelpMessage(version: string): string {
|
||||
let columns = (<any>process.stdout).isTTY ? (<any>process.stdout).columns : 80;
|
||||
return `Visual Studio Code v${ version }
|
||||
export function buildHelpMessage(fullName: string, name: string, version: string): string {
|
||||
const columns = (<any>process.stdout).isTTY ? (<any>process.stdout).columns : 80;
|
||||
const executable = `${ name }${ os.platform() === 'win32' ? '.exe' : '' }`;
|
||||
|
||||
return `${ fullName } ${ version }
|
||||
|
||||
Usage: ${ executable } [arguments] [paths...]
|
||||
${ localize('usage', "Usage") }: ${ executable } [${ localize('options', "options") }] [${ localize('paths', 'paths') }...]
|
||||
|
||||
Options:
|
||||
${ localize('optionsUpperCase', "Options") }:
|
||||
${formatOptions(optionsHelp, columns)}`;
|
||||
}
|
||||
@@ -29,7 +29,7 @@ export function main(argv: string[]): TPromise<void> {
|
||||
}
|
||||
|
||||
if (args.help) {
|
||||
console.log(buildHelpMessage(pkg.version));
|
||||
console.log(buildHelpMessage(product.nameLong, product.applicationName, pkg.version));
|
||||
} else if (args.version) {
|
||||
console.log(`${ pkg.version } (${ product.commit })`);
|
||||
} else if (shouldSpawnCliProcess(args)) {
|
||||
|
||||
Reference in New Issue
Block a user