Merge commit 'refs/pull/358/head' of github.com:Microsoft/vscode-vsce into pr/358
This commit is contained in:
commit
99978276f6
3 changed files with 19 additions and 1 deletions
|
@ -39,6 +39,7 @@
|
|||
"cheerio": "^1.0.0-rc.1",
|
||||
"commander": "^2.8.1",
|
||||
"denodeify": "^1.2.1",
|
||||
"didyoumean": "^1.2.1",
|
||||
"glob": "^7.0.6",
|
||||
"lodash": "^4.17.10",
|
||||
"markdown-it": "^8.3.1",
|
||||
|
@ -57,6 +58,7 @@
|
|||
"devDependencies": {
|
||||
"@types/cheerio": "^0.22.1",
|
||||
"@types/denodeify": "^1.2.31",
|
||||
"@types/didyoumean": "^1.2.0",
|
||||
"@types/glob": "^7.1.1",
|
||||
"@types/lodash": "^4.14.123",
|
||||
"@types/markdown-it": "0.0.2",
|
||||
|
|
13
src/main.ts
13
src/main.ts
|
@ -1,4 +1,6 @@
|
|||
import * as program from 'commander';
|
||||
import * as didYouMean from 'didyoumean';
|
||||
|
||||
import { packageCommand, ls } from './package';
|
||||
import { publish, unpublish } from './publish';
|
||||
import { show } from './show';
|
||||
|
@ -128,7 +130,16 @@ module.exports = function (argv: string[]): void {
|
|||
|
||||
program
|
||||
.command('*')
|
||||
.action(() => program.help());
|
||||
.action((cmd: string) => {
|
||||
program.outputHelp();
|
||||
log.error(`Unknown command ${cmd}`);
|
||||
|
||||
const availableCommands: string[] = program.commands.map(c => c._name);
|
||||
const suggestion: string | string[] = didYouMean(cmd, availableCommands);
|
||||
if (suggestion) {
|
||||
log.warn(`Did you mean '${suggestion}'?`);
|
||||
}
|
||||
});
|
||||
|
||||
program.parse(argv);
|
||||
|
||||
|
|
|
@ -566,6 +566,11 @@ detect-libc@^1.0.2:
|
|||
resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b"
|
||||
integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=
|
||||
|
||||
didyoumean@^1.2.1:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/didyoumean/-/didyoumean-1.2.1.tgz#e92edfdada6537d484d73c0172fd1eba0c4976ff"
|
||||
integrity sha1-6S7f2tplN9SE1zwBcv0eugxJdv8=
|
||||
|
||||
diff@3.5.0:
|
||||
version "3.5.0"
|
||||
resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12"
|
||||
|
|
Loading…
Add table
Reference in a new issue