Skip to content

Commit b9fb103

Browse files
committed
Add -v alias for --version.
1 parent 40ac4a1 commit b9fb103

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ groupFunction* Customize how packages are divided into groups
254254
[])
255255
-ws, --workspaces Run on all workspaces. Add --root to also upgrade
256256
the root project.
257-
-V, --version Output the version number.
257+
-v, -V, --version Output the version number.
258258
-h, --help You're lookin' at it.
259259
```
260260

src/bin/cli.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env node
2-
import { Help, program } from 'commander'
2+
import Commander, { Help, program } from 'commander'
33
import cloneDeep from 'lodash/cloneDeep'
44
import pickBy from 'lodash/pickBy'
55
import semver from 'semver'
@@ -91,11 +91,14 @@ ${chalk.dim.underline(
9191
program
9292
.description('[filter] is a list or regex of package names to check (all others will be ignored).')
9393
.usage('[options] [filter]')
94+
.addOption(new Commander.Option('-v, --version', 'Version!').hideHelp())
9495
// See: boolean optional arg below
9596
.configureHelp({
9697
optionTerm: option =>
9798
option.long && noCli.has(option.long)
9899
? option.long.replace('--', '') + '*'
100+
: option.long === '--version'
101+
? '-v, -V, --version'
99102
: option.flags.replace('[bool]', ''),
100103
optionDescription: option =>
101104
option.long === '--version'

0 commit comments

Comments
 (0)