Skip to content

Commit 06951d9

Browse files
authored
Merge pull request #1103 from microsoft/benibenj/adequate-stoat
Update command line parameters for consistency
2 parents 033d602 + d973b56 commit 06951d9

File tree

3 files changed

+25
-19
lines changed

3 files changed

+25
-19
lines changed

package-lock.json

+16-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"chalk": "^2.4.2",
4545
"cheerio": "^1.0.0-rc.9",
4646
"cockatiel": "^3.1.2",
47-
"commander": "^6.2.1",
47+
"commander": "^12.1.0",
4848
"form-data": "^4.0.0",
4949
"glob": "^11.0.0",
5050
"hosted-git-info": "^4.0.2",

src/main.ts

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import program from 'commander';
1+
import { Command, Option } from 'commander';
22
import leven from 'leven';
33
import { packageCommand, ls, Targets, generateManifest, verifySignature } from './package';
44
import { publish, unpublish } from './publish';
@@ -56,6 +56,8 @@ function main(task: Promise<any>): void {
5656
const ValidTargets = [...Targets].join(', ');
5757

5858
module.exports = function (argv: string[]): void {
59+
const program = new Command();
60+
5961
program.version(pkg.version).usage('<command>');
6062

6163
program
@@ -220,7 +222,8 @@ module.exports = function (argv: string[]): void {
220222
.option('--baseImagesUrl <url>', 'Prepend all relative image links in README.md with the specified URL.')
221223
.option('--yarn', 'Use yarn instead of npm (default inferred from presence of yarn.lock or .yarnrc)')
222224
.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))
224227
.option('--allow-proposed-apis <apis...>', 'Allow specific proposed APIs')
225228
.option('--allow-all-proposed-apis', 'Allow all proposed APIs')
226229
.option('--ignoreFile <path>', 'Indicate alternative .vscodeignore')
@@ -256,6 +259,7 @@ module.exports = function (argv: string[]): void {
256259
baseContentUrl,
257260
baseImagesUrl,
258261
yarn,
262+
verify,
259263
noVerify,
260264
allowProposedApis,
261265
allowAllProposedApis,
@@ -292,7 +296,7 @@ module.exports = function (argv: string[]): void {
292296
baseContentUrl,
293297
baseImagesUrl,
294298
useYarn: yarn,
295-
noVerify,
299+
noVerify: noVerify || !verify,
296300
allowProposedApis,
297301
allowAllProposedApis,
298302
ignoreFile,
@@ -387,7 +391,7 @@ module.exports = function (argv: string[]): void {
387391
}
388392

389393
program.outputHelp(help => {
390-
const availableCommands = program.commands.map(c => c._name);
394+
const availableCommands = program.commands.map(c => c.name());
391395
const suggestion = availableCommands.find(c => leven(c, cmd) < c.length * 0.4);
392396

393397
help = `${help}\n Unknown command '${cmd}'`;

0 commit comments

Comments
 (0)