Added logic in command-line parser to print usage if no files or projects are specified.

Added "bin" section to project.json.
Bumped version to 1.0.3.
This commit is contained in:
Eric Traut 2019-03-24 03:31:37 -07:00
parent c9b18356a4
commit e7e9e0a8eb
7 changed files with 16 additions and 8 deletions

View File

@ -1,6 +1,6 @@
{
"name": "pyright",
"version": "1.0.2",
"version": "1.0.3",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -2,7 +2,7 @@
"name": "pyright",
"displayName": "Pyright",
"description": "VS Code language support and type checking for Python",
"version": "1.0.2",
"version": "1.0.3",
"license": "MIT",
"author": {
"name": "Microsoft Corporation"

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "pyright",
"version": "1.0.2",
"version": "1.0.3",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -2,7 +2,7 @@
"name": "pyright",
"displayName": "Pyright",
"description": "Type checker for the Python language",
"version": "1.0.2",
"version": "1.0.3",
"license": "MIT",
"author": {
"name": "Microsoft Corporation"
@ -26,5 +26,8 @@
"@types/node": "^11.10.5",
"typescript": "^3.2.2"
},
"main": "index.js"
"main": "index.js",
"bin": {
"pyright": "index.js"
}
}

View File

@ -1,6 +1,6 @@
{
"name": "pyright",
"version": "1.0.2",
"version": "1.0.3",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -2,7 +2,7 @@
"name": "pyright",
"displayName": "pyright",
"description": "Type checker for the Python language",
"version": "1.0.2",
"version": "1.0.3",
"license": "MIT",
"scripts": {
"start": "npm run start:analyzer && npm run start:server",

View File

@ -80,6 +80,11 @@ function processArgs() {
let watch = !!args.watch;
options.watch = watch;
if ((options.fileSpecs === undefined || options.fileSpecs.length === 0) && !args.project) {
printUsage();
return;
}
let service = new AnalyzerService();
service.setCompletionCallback(results => {
@ -110,7 +115,7 @@ function processArgs() {
function printUsage() {
console.log(
'Usage: ' + toolName + ' [options] file...\n' +
'Usage: ' + toolName + ' [options] files...\n' +
' Options:\n' +
' -h,--help Show this help message\n' +
' -P,--python-path DIRECTORY Directory that contains the python environment\n' +