Small tweaks to version printing code.

This commit is contained in:
Eric Traut 2019-05-09 08:21:22 -07:00
parent c3ca99be3f
commit 2f148e88a7
2 changed files with 5 additions and 3 deletions

View File

@ -10,7 +10,7 @@ Pyright can be run as either a VS Code extension or as a node-based command-line
| -t, --typeshed-path DIRECTORY | Use typeshed type stubs at this location (1) |
| -v, --venv-path DIRECTORY | Directory that contains virtual environments (2) |
| --verbose | Emit verbose diagnostics |
| --version | Print Pyright version |
| --version | Print pyright version |
| -w, --watch | Continue to run and watch for changes (3) |

View File

@ -67,7 +67,8 @@ function processArgs() {
printVersion();
return;
}
let options = new PyrightCommandLineOptions(process.cwd(), false);
const options = new PyrightCommandLineOptions(process.cwd(), false);
// Assume any relative paths are relative to the working directory.
if (args.files && Array.isArray(args.files)) {
@ -149,7 +150,8 @@ function printUsage() {
}
function printVersion() {
console.log( 'Pyright ' + String(require('package.json').version));
const version = require('package.json').version;
console.log(`${ toolName } ${ version.toString() }`);
}
function reportDiagnostics(fileDiagnostics: FileDiagnostics[]): number {