|
1 |
| -import program from 'commander'; |
| 1 | +import { Command, Option } from 'commander'; |
2 | 2 | import leven from 'leven';
|
3 | 3 | import { packageCommand, ls, Targets, generateManifest, verifySignature } from './package';
|
4 | 4 | import { publish, unpublish } from './publish';
|
@@ -56,6 +56,8 @@ function main(task: Promise<any>): void {
|
56 | 56 | const ValidTargets = [...Targets].join(', ');
|
57 | 57 |
|
58 | 58 | module.exports = function (argv: string[]): void {
|
| 59 | + const program = new Command(); |
| 60 | + |
59 | 61 | program.version(pkg.version).usage('<command>');
|
60 | 62 |
|
61 | 63 | program
|
@@ -220,7 +222,8 @@ module.exports = function (argv: string[]): void {
|
220 | 222 | .option('--baseImagesUrl <url>', 'Prepend all relative image links in README.md with the specified URL.')
|
221 | 223 | .option('--yarn', 'Use yarn instead of npm (default inferred from presence of yarn.lock or .yarnrc)')
|
222 | 224 | .option('--no-yarn', 'Use npm instead of yarn (default inferred from absence of yarn.lock or .yarnrc)')
|
223 |
| - .option('--noVerify', 'Allow all proposed APIs (deprecated: use --allow-all-proposed-apis instead)') |
| 225 | + .option('--no-verify', 'Allow all proposed APIs (deprecated: use --allow-all-proposed-apis instead)') |
| 226 | + .addOption(new Option('--noVerify', 'Allow all proposed APIs (deprecated: use --allow-all-proposed-apis instead)').hideHelp(true)) |
224 | 227 | .option('--allow-proposed-apis <apis...>', 'Allow specific proposed APIs')
|
225 | 228 | .option('--allow-all-proposed-apis', 'Allow all proposed APIs')
|
226 | 229 | .option('--ignoreFile <path>', 'Indicate alternative .vscodeignore')
|
@@ -256,6 +259,7 @@ module.exports = function (argv: string[]): void {
|
256 | 259 | baseContentUrl,
|
257 | 260 | baseImagesUrl,
|
258 | 261 | yarn,
|
| 262 | + verify, |
259 | 263 | noVerify,
|
260 | 264 | allowProposedApis,
|
261 | 265 | allowAllProposedApis,
|
@@ -292,7 +296,7 @@ module.exports = function (argv: string[]): void {
|
292 | 296 | baseContentUrl,
|
293 | 297 | baseImagesUrl,
|
294 | 298 | useYarn: yarn,
|
295 |
| - noVerify, |
| 299 | + noVerify: noVerify || !verify, |
296 | 300 | allowProposedApis,
|
297 | 301 | allowAllProposedApis,
|
298 | 302 | ignoreFile,
|
@@ -387,7 +391,7 @@ module.exports = function (argv: string[]): void {
|
387 | 391 | }
|
388 | 392 |
|
389 | 393 | program.outputHelp(help => {
|
390 |
| - const availableCommands = program.commands.map(c => c._name); |
| 394 | + const availableCommands = program.commands.map(c => c.name()); |
391 | 395 | const suggestion = availableCommands.find(c => leven(c, cmd) < c.length * 0.4);
|
392 | 396 |
|
393 | 397 | help = `${help}\n Unknown command '${cmd}'`;
|
|
0 commit comments