diff --git a/package-lock.json b/package-lock.json index 0098f3e4..d5fd9d46 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "@typescript-eslint/parser": "^7.2.0", "chalk": "^5.3.0", "cli-table3": "^0.6.3", - "commander": "^11.1.0", + "commander": "^12.0.0", "fast-glob": "^3.3.2", "fast-memoize": "^2.5.2", "find-up": "5.0.0", @@ -2778,11 +2778,11 @@ } }, "node_modules/commander": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", - "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.0.0.tgz", + "integrity": "sha512-MwVNWlYjDTtOjX5PiD7o5pK0UrFU/OYgcJfjjK4RaHZETNtjJqrZa9Y9ds88+A+f+d5lv+561eZ+yCKoS3gbAA==", "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/comment-parser": { @@ -5828,6 +5828,15 @@ "node": ">=18" } }, + "node_modules/markdownlint-cli/node_modules/commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "dev": true, + "engines": { + "node": ">=16" + } + }, "node_modules/markdownlint-cli/node_modules/get-stdin": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-9.0.0.tgz", diff --git a/package.json b/package.json index aa9cdb5a..241f9146 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "@typescript-eslint/parser": "^7.2.0", "chalk": "^5.3.0", "cli-table3": "^0.6.3", - "commander": "^11.1.0", + "commander": "^12.0.0", "fast-glob": "^3.3.2", "fast-memoize": "^2.5.2", "find-up": "5.0.0", diff --git a/src/bin/cli.ts b/src/bin/cli.ts index f63e3c6f..fde8b6e2 100755 --- a/src/bin/cli.ts +++ b/src/bin/cli.ts @@ -100,8 +100,6 @@ ${chalk.dim.underline( program .description('[filter] is a list or regex of package names to check (all others will be ignored).') .usage('[options] [filter]') - // add hidden -v alias for --V/--version - .addOption(new Commander.Option('-v, --version').hideHelp()) // See: boolean optional arg below .configureHelp({ optionTerm: option => @@ -117,6 +115,12 @@ ${chalk.dim.underline( ? `You're lookin' at it.` : Help.prototype.optionDescription(option), }) + // add hidden -v alias for --V/--version + .addOption(new Commander.Option('-v, --versionAlias').hideHelp()) + .on('option:versionAlias', () => { + console.info(pkg.version) + process.exit(0) + }) // add cli options cliOptions.forEach(({ long, short, arg, description, default: defaultValue, help, parse, type }) => {